The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Translating PHP to vB specifications
Hi I've been using vB for a while now, while coding on the side I never got up the courage to ask for help on how to incorporate my style of coding with vB.
I learn best by visual representation and I was wondering if someone could a snippet of an example code that I provide, and rebuild it so that it fits the qualifications of vB. Actually several little codes so that I can get the gist of how to do it myself, anyway here are the examples I need to be shown to translate into vB: Code:
$query = "SELECT * FROM ".$prefix."users WHERE username='$loggedinname'"; $result = mysql_query($query); $num = mysql_numrows($result); //Loop out code $i=0; while ($i < 1) { $newmessagenotify=@mysql_result($result,$i,"newmessagenotify"); $website=@mysql_result($result,$i,"website"); $website = stripslashes($website); $i++; } I realize my style of PHP is far from the effenciency that vB uses, which is why I am having so much trouble grasping it without visual representation. Code:
$act=$_REQUEST["act"]; $action=$_REQUEST["action"]; if($act=="changesettings" and $action==""){ $action="";} if($act=="changesettings" and $action=="1"){ <a href='?act=changesettings&action=1'><b>Profile Design</b></a>- <a href='?act=changesettings&action=2'>Contact Info</a>- <a href='?act=changesettings&action=3'>Personal Info</a>- <a href='?act=changesettings&action=4'>Display Pictue</a> <a href='?act=changesettings&action=5'>Friends</a>- <a href='?act=changesettings&action=6'>Signature</a> } elseif($act=="changesettings" and $action=="2"){ <a href='?act=changesettings&action=1'>Profile Design</a>- <a href='?act=changesettings&action=2'><b>Contact Info</b></a>- <a href='?act=changesettings&action=3'>Personal Info</a>- <a href='?act=changesettings&action=4'>Display Pictue</a> <a href='?act=changesettings&action=5'>Friends</a>- <a href='?act=changesettings&action=6'>Signature</a> <form name='form1' method='post' action='accountpost.php'> <p>Forum signature, a max character limit of 800 is in effect:<br /> <textarea name='signature' type='text' id='signature' cols='40' rows='3'>".$signature."</textarea><br> <input name='act' type='hidden' id='act' value='changesettings'> <input name='action' type='hidden' id='action' value='6'> </p> <p> <input type='submit' name='Submit' value='Submit Details'> </p> </form> } elseif($act=="changesettings" and $action==""){ <a href='?act=changesettings&action=1'>Profile Design</a>- <a href='?act=changesettings&action=2'>Contact Info</a>- <a href='?act=changesettings&action=3'>Personal Info</a>- <a href='?act=changesettings&action=4'>Display Pictue</a> <a href='?act=changesettings&action=5'>Friends</a>- <a href='?act=changesettings&action=6'>Signature</a> } |
#2
|
||||
|
||||
For queries, instead of:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
@Lynne - Your help is appreciated.
As I mentioned before, I work best with visual representation. If there are any coders out there experienced enough with working with vB, please PM if you can help this new comer get started. I can't do this properly if I don't have someone who can answer my questions and better understand the coding that goes with vBulletin. All help is appreciated. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|