php forum
php mysql forum
php mysql smarty
 
Topic Options
#225546 - 09/28/02 06:39 PM Graemlins Sort Order
dimopoulos Offline
Kahuna

Registered: 08/18/02
Posts: 1271
Loc: Vienna, Austria
Mod Name / Version Graemlins Sort Order 1.0<br />Description Allows you to sort the order on which the graemlins are shown in the post screens. Also it helps in decoding the graemlin codes.<br />Working under UBB.threads 6.1<br />Any pre-requisites None<br />Author(s) dimopoulos<br />Credits threadsdev.com who taught me how to do things in php and ubb threads<br />Demo None.<br />Files Altered admin/menu.php, ubbt.inc.php, optionally ubbt_instant_ubbcode.tmpl<br />Database Altered Yes<br />New Files dochangegrmorder.php, changegrmorder.php<br />Any other info Please report any problems you might have and I'll try to fix them as soon as possible. Sorry but I have tested this only in version 6.1.<br /><br /><br />INSTALL<br />Step 1<br />Open the file ubbt.inc.php<br /><br />Step 1.1: Find a line that looks like this (at line 600):<br /><pre><font class="small">code:</font><hr><br /> // Convert the smileys<br /> // First grab all smileys out of the database<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Smiley<br /> ";<br /></pre><hr><br /><br />And change it to this (we are adding an ORDER BY statement in the query)<br /><pre><font class="small">code:</font><hr><br /> // Convert the smileys<br /> // First grab all smileys out of the database<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Location DESC<br /> ";<br /></pre><hr><br /><br />Step 1.2: Then find this line (around line 700):<br /><pre><font class="small">code:</font><hr><br /> // Convert the smileys<br /> // First grab all smileys out of the database<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Smiley<br /> ";<br /></pre><hr><br /><br />And change it to this (we are adding an ORDER BY statement in the query)<br /><pre><font class="small">code:</font><hr><br /> // Convert the smileys<br /> // First grab all smileys out of the database<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Location DESC<br /> ";<br /></pre><hr><br /><br />Step 1.3: Then find this line (around line 1640):<br /><pre><font class="small">code:</font><hr><br /> // --------------------------------------------------<br /> // We need to grab all of the graemlins out of the db<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ";<br /></pre><hr><br /> <br />And change it to this (we are adding an ORDER BY statement in the query)<br /><pre><font class="small">code:</font><hr><br /> // --------------------------------------------------<br /> // We need to grab all of the graemlins out of the db<br /> $query = "<br /> SELECT G_Code,G_Smiley,G_Image<br /> FROM {$config['tbprefix']}Graemlins<br /> ORDER BY G_Location<br /> ";<br /></pre><hr><br /><br /><br />Step 2<br />Open up the file admin/menu.php and do the following:<br /><br />Step 2.1: Find these lines (around line 320):<br /><pre><font class="small">code:</font><hr><br /> <br><br /> <a href="{$config['phpurl']}/admin/removegraemlin.php?Cat=$Cat" target="mainFrame">Remove a graemlin</a><br /> <br><br /></pre><hr><br /><br />And ADD the following AFTER:<br /><pre><font class="small">code:</font><hr><br /> <a href="{$config['phpurl']}/admin/changegrmorder.php?Cat=$Cat" target="mainFrame">Sort graemlins order</a><br /> <br><br /></pre><hr><br /><br />Step 3<br />Upload the files changegrmorder.php and dochangegrmorder.php in your admin folder<br /><br /><br />Step 4<br />Run phpMyAdmin and change the Graemlins table (usually w3t_Graemlins) by adding the following field<br /><pre><font class="small">code:</font><hr><br />G_Location INT(11) NULL DEFAULT = 0 (this is zero and not the letter 'O')<br /></pre><hr><br /><br />the sql script to do so is:<br /><pre><font class="small">code:</font><hr><br />ALTER TABLE `w3t_graemlins` ADD `G_Location` INT( 11 ) DEFAULT '0'<br /></pre><hr><br /><br />The INT(11) is optional. I think a normal INT will suffice.<br /><br /><br />OPTIONAL STEP<br /><br />Step 5<br />The way the post screens are sructured, the graemlins might push down the 'Submit' button. Hence we can<br />modify that page to show on two lines the UBB codes, the colors on the next line and below all the <br />graemlins. This saves space (see attached screenshot)<br /><br />Step 5.1<br />Open the ubbt_instant_ubbcode.tmpl and find this (around line 180):<br /><pre><font class="small">code:</font><hr><br /></script><br /></pre><hr><br /><br />and CHANGE EVERYTHING below it to this:<br /><pre><font class="small">code:</font><hr><br /><table border="1"><br /><tr class="tdheader"><br /><td><br /><b>{$ubbt_lang['INST_UBB']}</b><br /></td><br /></tr><br /></table><br /><table border="1"><br /><tr><br /><td valign="top" align="left" nowrap="nowrap" class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('url');">{$ubbt_lang['J_HYPER']}</a><br /></td><br /><td class="darktable"><br /> <a href="javascript: x()" onclick="DoPrompt('email');">{$ubbt_lang['J_EMAIL']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('image');">{$ubbt_lang['J_IMAGE']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('liststart');">{$ubbt_lang['J_LISTSTART']}</a><br /></td><br /><td class="darktable"><br /> <a href="javascript: x()" onclick="DoPrompt('listitem');">{$ubbt_lang['J_LISTITEM']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('listend');">{$ubbt_lang['J_LISTEND']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('bold');">{$ubbt_lang['J_BOLD']}</a><br /></td><br /></tr><br /><tr><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('pollstart');">{$ubbt_lang['J_POLLSTART']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('polloption');">{$ubbt_lang['J_POLLOPTION']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('pollstop');">{$ubbt_lang['J_POLLSTOP']}</a><br /></td><br /><td class="darktable"><br /> <a href="javascript: x()" onclick="DoPrompt('italics');">{$ubbt_lang['J_ITALICS']}</a><br /></td><br /><td class="darktable"><br /> <a href="javascript: x()" onclick="DoPrompt('underline');">{$ubbt_lang['J_UNDERLINE']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('quote');">{$ubbt_lang['J_QUOTE']}</a><br /></td><br /><td class="darktable"><br /><a href="javascript: x()" onclick="DoPrompt('code');">{$ubbt_lang['J_CODE']}</a><br /></td><br /></tr><br /></table><br /><table border="1"><br /><tr class="tdheader"><br /><td><br /><b>{$ubbt_lang['FONT_COLOR']}</b><br /></td><br /><td bgcolor="red"><br /> <a href="javascript: x()" onclick="DoColor('red');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="green"><br /> <a href="javascript: x()" onclick="DoColor('green');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="blue"><br /> <a href="javascript: x()" onclick="DoColor('blue');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="white"><br /> <a href="javascript: x()" onclick="DoColor('white');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="orange"><br /> <a href="javascript: x()" onclick="DoColor('orange');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="yellow"><br /> <a href="javascript: x()" onclick="DoColor('yellow');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="black"><br /> <a href="javascript: x()" onclick="DoColor('black');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="purple"><br /> <a href="javascript: x()" onclick="DoColor('purple');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="pink"><br /> <a href="javascript: x()" onclick="DoColor('pink');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="brown"><br /> <a href="javascript: x()" onclick="DoColor('brown');">&nbsp; &nbsp; </a><br /></td><br /><td bgcolor="#666666"><br /> <a href="javascript: x()" onclick="DoColor('#666666');">&nbsp; &nbsp; </a><br /></td><br /><td><br /> <a href="javascript: x()" onclick="DoPrompt('color');">?</a><br /></td><br /></tr><br /></table><br /><table border="1"><br /><tr class="tdheader"><br /><td><br /><b>{$ubbt_lang['INST_GRAEMLIN']}</b><br /></td><br /></tr><br /></table><br /><table border="1"><br /><tr><br /><tr><br /><td valign="top" align="left"><br />$graemlinlist<br /></td><br /></tr><br /></table><br /></pre><hr><br /><br />Bare in mind that I have applied the Underline UBB Code Hack on the template. Hence you can see the <br /><pre><font class="small">code:</font><hr><br /><td class="darktable"><br /> <a href="javascript: x()" onclick="DoPrompt('underline');">{$ubbt_lang['J_UNDERLINE']}</a><br /></td><br /></pre><hr><br />which you might not have in your original template. Please remove if you haven't applied the Underline UBB Code Hack.<br /><br />Step 5.2<br />Open the ubbt_inc.php and find this (around line 1830):<br /><pre><font class="small">code:</font><hr><br /> $i++;<br /> if ($i==6) {<br /> $i=0;<br /> $graemlinlist .= "<br />";<br /> }<br /></pre><hr><br /><br />and replace everything below it with (we are commenting out the <BR> every 6 graemlins:<br /><pre><font class="small">code:</font><hr><br />// $i++;<br />// if ($i==6) {<br />// $i=0;<br />// $graemlinlist .= "<br />";<br />// }<br /></pre><hr><br /><br />Warm regards<br /><br />Nikos


Attachments
57890-Graemlins_Sort_Order_1_0.zip (34 downloads)

_________________________
Nikos

Top
#225547 - 09/28/02 07:00 PM Re: Graemlins Sort Order [Re: Hal_dup2]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Cool!<br /><br />This is much needed. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Thanks!
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#225548 - 09/28/02 07:04 PM Re: Graemlins Sort Order [Re: Daine]
dimopoulos Offline
Kahuna

Registered: 08/18/02
Posts: 1271
Loc: Vienna, Austria
No problem Josh. I only hope that this is useful to all and will not cause any major problems since it is my first try for a hack <img src="/forum/images/graemlins/cool.gif" alt="" /><br /><br />Warm regards<br /><br />Nikos
_________________________
Nikos

Top
#225549 - 08/03/03 07:53 PM Re: Graemlins Sort Order [Re: Hal_dup2]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks