IPB

Welcome Guest ( Log In | Register )

Php -> Ipb

This topic is about Php -> Ipb, the author, Lewtheo, wrote about: On a localhost I have been developing a PHP voting system that is heavily SQL based, I was wondering if I wanted to implement my latest version into IPB, how could I do that>? I have a component -> a ... To read more just scroll down

 
Reply to this topicStart new topic
Php -> Ipb
Kirk
post Aug 4 2007, 01:19 PM
Post #1


Advanced Member
***

Group: Members
Posts: 86
Joined: 27-June 07
Member No.: 3



On a localhost I have been developing a PHP voting system that is heavily SQL based, I was wondering if I wanted to implement my latest version into IPB, how could I do that>?

I have a component -> autocom=vote, but not sure how to go further than this, as you are a great developer and understand PHP & IPB, I thought I would ask here

Thanks,
Lew
Go to the top of the page
 
+Quote Post
bramburn
post Aug 8 2007, 04:38 PM
Post #2


Administrator
***

Group: Root Admin
Posts: 905
Joined: 25-June 07
From: London
Member No.: 1



oouch well you might want to read this
http://www.invisionpower.com/files/ipb23devdocs.pdf

QUOTE
heavily SQL based,

aren't all application like that smile.gif

You would also need to understand how classes and functions all work before I can explain it all to you.

a few simple things:
SQL connection is already started when you view the page so there is none needed in autocom=
to query something use:
QUOTE
$this->ipsclass->DB->query();


acts like:
QUOTE
mysql_query()


if you are stuck on how to use some SQL function go to ips_kernel/class_db_mysql.php and ips_kernel/class_db.php and read off the comments, it helps you out a lot.

It would be best if you asked for specific questions where I can help you out, as I do not have much time writting guides on how to teach you to write php (well for now)


--------------------
Remember to please use the bug tracker for all bugs and errors, it is more organised that way.
Support in french and english
If I reply in French please excuse my spelling & grammar, i haven't written in french for a long time.
DO NOT PM ME TO ASK ME TO GO ON MSN, post the query on the support forums!
Go to the top of the page
 
+Quote Post
Kirk
post Aug 10 2007, 01:42 PM
Post #3


Advanced Member
***

Group: Members
Posts: 86
Joined: 27-June 07
Member No.: 3



I read through the guide, didn't really make much sense haha

I created the basic autocom=vote page, I've got seperate files for every piece of the component

Can I send you some of the latest files, so you can give me a kick up the backside and show me how I would link it into the componenets_public etc scripts?

Just let me know, thanks smile.gif

Of course it doesn't have to be at all soon, make sure your work is top of the list smile.gif
Go to the top of the page
 
+Quote Post
bramburn
post Aug 10 2007, 01:47 PM
Post #4


Administrator
***

Group: Root Admin
Posts: 905
Joined: 25-June 07
From: London
Member No.: 1



ill see if tomorrow I can write a guide on how to start up a component_public as I am going to be writing a guide on how to setup the plugins and use Mseo + a few tips on SEO, which should help you out a lil bit.


--------------------
Remember to please use the bug tracker for all bugs and errors, it is more organised that way.
Support in french and english
If I reply in French please excuse my spelling & grammar, i haven't written in french for a long time.
DO NOT PM ME TO ASK ME TO GO ON MSN, post the query on the support forums!
Go to the top of the page
 
+Quote Post
Kirk
post Aug 12 2007, 01:16 PM
Post #5


Advanced Member
***

Group: Members
Posts: 86
Joined: 27-June 07
Member No.: 3



Okay I finished the main PHP Installer for normal PHP installation, going to spread the word about the system and put it up for download when I get back from my holiday, after that, on my plans is to start the implementation into IPB

But first I got to enjoy the rest of my holidays smile.gif
Go to the top of the page
 
+Quote Post
Kirk
post Aug 15 2007, 10:31 AM
Post #6


Advanced Member
***

Group: Members
Posts: 86
Joined: 27-June 07
Member No.: 3



I wanted to make a start on this, unsure of what you mean, this is basically what lots of my SQL looks like:

CODE
$on_score = 'SELECT `onscore` FROM `rp_main` WHERE id=1';
$on_score_a = mysql_query($on_score) or die('Query failed: ' . mysql_error());
$on_score_res = mysql_fetch_array($on_score_a);
foreach($on_score_res as $onscoreview){
}


How do you change that?

And my PHP:

CODE
<?php
$file = file_get_contents ('./include/locked.txt');
if ($file == "LOCKED") {
echo "";
} else {
    header('Location: ./install');
exit();    
}
?>
<?php
require_once('include/conf_global.php');
require_once('include/codes.php');
require_once('include/awards.php');
mysql_select_db($database);
$ip = $_SERVER['REMOTE_ADDR'];
?>


CODE
<?php
switch ($_GET['score']) {
case $cat_1:
if ( $onscoreview == "1" and ( $cat_1_on == "1")) {
    require ($cat_1_url);
} else {
    echo "<table width='65%' border='0' cellspacing='5'><tr><td id='noborder'>Viewing the scores publically has been disabled for the time being.<br />This is until the voting has reached a near end of which we will make the score viewing public.<br />This has been decided so that there is no influencing on who you wish to vote for<br /><br />Thanks - "; echo $title; echo ' Awards '; echo $group; echo '</tr></td></table>';
}
break;


Slighty stuck laugh.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet


 



RSS Lo-Fi Version | Sitemap  | SEO by MinervaSEO © Icelabz.net Time is now: 2nd December 2008 - 02:03 PM