vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Change the display order of smilies (https://vborg.vbsupport.ru/showthread.php?t=25888)

Admin 08-19-2001 10:00 PM

Description:
This hack will allow you to set the display order of clickable smilies (if you use them).
It's good if you have a lot of smilies, and want the more commonly used to be shown in the box.

Demo:
http://forum.t-cove.com/order.gif

Installation:
1. Run the following queries either in phpMyAdmin or thru Telnet: (one query at a time)
Code:

ALTER TABLE smilie ADD showid SMALLINT not null
ALTER TABLE smilie ADD INDEX (showid)
UPDATE smilie SET showid=smilieid

2. In functions.php (in your admin folder) replace
PHP Code:

$smilies $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie"); 

with
PHP Code:

$smilies $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY showid"); 

And also replace
PHP Code:

$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie"); 

with
PHP Code:

$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie ORDER BY showid"); 

3. In smilie.php (in your admin folder) replace
PHP Code:

$smilies=$DB_site->query("SELECT smilietext,smilieid,title,smiliepath FROM smilie ORDER BY title LIMIT ".($limitlower-1).",$perpage"); 

with
PHP Code:

$smilies=$DB_site->query("SELECT smilietext,smilieid,title,smiliepath,showid FROM smilie ORDER BY showid LIMIT ".($limitlower-1).",$perpage"); 

Below
PHP Code:

echo makelinkcode("remove","smilie.php?s=$session[sessionhash]&action=remove&smilieid=$smilie[smilieid]&perpage=$perpage&statrpage=$startpage"); 

add
PHP Code:

echo "<br>Order: <input type=text name=\"order[$smilie[smilieid]]\" size=5 value=\"$smilie[showid]\">"

Replace
PHP Code:

echo "</table></td></tr></table></form>"

with
PHP Code:

doformfooter("Update order"); 

Replace
PHP Code:

doformheader("smilie","modify"); 

with
PHP Code:

doformheader("smilie","doorder"); 

Above
PHP Code:

// ###################### Start Modify ####################### 

add
PHP Code:

// ###################### Start do order #####################
if ($HTTP_POST_VARS['action']=="doorder") {

  while (list(
$key,$val)=each($order)) {

    
$DB_site->query("UPDATE smilie SET showid='$val' WHERE smilieid='$key'");

  }

  echo 
"<p>Order updated!</p>";
  
$action="modify";



Requested by:
JJR512

That's it! Feedback, requests and anything else is more than welcome. :)
Good luck! :D

dxb 08-20-2001 07:47 AM

nice simple and effective .... I'll try it now :)

JJR512 08-20-2001 07:55 AM

Alright, it's done, and it's great!

You know in the other thread I was about to say that the one line replacement you had originally (which added the ORDER BY bit) didn't work. I guess there was a lot more to it, though! :D Hope it wasn't too much trouble...but I love it! Thank you! :)

Admin 08-20-2001 07:57 AM

Yeah I know JJR, I forgot to replace another line. :o

Hoffi 08-20-2001 09:13 AM

Cool Hack and it works directly.
Good work.

weezle 08-20-2001 09:40 AM

kool hack m8 ur on fire with these hacks @ the mo

Zecherieh 08-20-2001 11:27 PM

I was actually doing something similiar at the same time, but wanted random


2. In functions.php (in your admin folder) replace
PHP Code:

$smilies $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie"); 

with
PHP Code:

$smilies $DB_site->query("SELECT smilieid*0+RAND() AS randcol, title, smilietext, smiliepath FROM smilie ORDER BY randcol"); 

And also replace
PHP Code:

$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie"); 

with
PHP Code:

$smilies=$DB_site->query("SELECT smilieid*0+RAND() AS randcol, smilietext,smiliepath FROM smilie ORDER BY randcol"); 


dost 08-21-2001 08:38 AM

Thanks FireFly, it works great!

snyx 08-21-2001 08:39 PM

omg, do I ever want this!
but I never thought of it as a hack?
THANKS MAN!

*snyx runs off to install*

snyx 08-21-2001 08:41 PM

I tired to copy paste the queries into phpmyadmin and I get errors?

dost 08-21-2001 09:40 PM

[QUOTE]Originally posted by snyx
I tired to copy paste the queries into phpmyadmin and I get errors?

snyx 08-21-2001 09:49 PM

I obviously tried that genius!

dost 08-21-2001 09:54 PM

How do you expect anyone to help you when you don't even tell what error you get?!? And do you always respond like that when people try to help you? :(

snyx 08-21-2001 10:09 PM

whatvere, I got it myself
but now Im getting this when I try to modify my smilies

Database error in vBulletin Control Panel: Invalid SQL: SELECT smilietext,smilieid,title,smiliepath,showid FROM smilie ORDER BY showid LIMIT 0,15
mysql error: Unknown column 'showid' in 'field list'
mysql error number: 1054
Date: Tuesday 21st of August 2001 07:06:03 PM
Script: /forums/admin/smilie.php?action=modify
Referer: http://www.xxxx-xxxx.com/forums/admi...php?action=nav


Ideas?

Admin 08-22-2001 05:28 AM

You didn't create the new field, showid.
Hold on a bit, I'll come up with a file to do everything itself.

snyx 08-22-2001 05:35 AM

sweet, thx

Admin 08-22-2001 06:49 AM

Try this file, upload it to your admin folder. Tell me if it worked!

snyx 08-22-2001 07:37 AM

I get this man
Database error in vBulletin Control Panel: Invalid SQL: ALTER TABLE smilie DROP showid
mysql error: Can't DROP 'showid'. Check that column/key exists
mysql error number: 1091
Date: Wednesday 22nd of August 2001 04:34:55 AM
Script: /forums/admin/orsmin.php
Referer: http://www.xxxx-xxxx.com/forums/admin/orsmin.php?

Admin 08-22-2001 07:43 AM

Use the second option.

snyx 08-22-2001 08:33 AM

Database error in vBulletin Control Panel: Invalid SQL: ALTER TABLE smilie ADD showid TINYINT not null
mysql error: Can't create/write to file './kaos_vbp/#sql-7db_262f.frm' (Errcode: 28)
mysql error number: 1
Date: Wednesday 22nd of August 2001 05:30:47 AM
Script: /forums/admin/orsmin.php
Referer: http://www.xxxx-xxxx.com/forums/admin/orsmin.php?

Admin 08-22-2001 12:32 PM

I just paid a little visit to your database (with your permission of course), and something is wrong with it, so I did a little search, and it looks like you're out of space in your MySQL partition.
(if you want, search for "mysql error: can't create/write file")
I suggest you have a little talk with your host.
Oh, and while you're at it, upgrade your phpMyAdmin :p

Sorry. :(

NYI Fan 08-23-2001 02:51 AM

Firefly;
Thanks for the hack, and the incredibly easy instructions (even a newbie like me could follow them!) Having a lot of smilies is now an easily managable thing!

:)

maverick1236 08-23-2001 02:43 PM

the random smilies are great-but if your in the middle of a post and u refresh to see another random set-you lose the post and need to start over-also could be a problem for those with the auto-refresh installed...

just a heads up!!:)

Hoffi 08-23-2001 06:58 PM

Just view all smilies on one Page. It's much, but it's OK and you can Edit the order completely.
I have 85 smilies on one Page, and it works excellent.

maverick1236 08-23-2001 07:10 PM

i have over 200 lol

Hoffi 08-23-2001 09:01 PM

u need a hugh Screen. :D

Sarge 08-25-2001 07:21 PM

Parse error: parse error in ./admin/functions.php on line 135

Fatal error: Call to undefined function: iif() in ./admin/functions.php on line 77

WTF?
I did everything right but it screwed my database

The dreaded white screen

Can anyone help?

Admin 08-25-2001 07:36 PM

What is line 135?
And did you run the queries successfully?

Sarge 08-25-2001 07:42 PM

yes I did run them sucessfully

I reverted back to my old functions and smilie php files but it didn't change the error

Line 135 is this

$l
if ($highlightlast) {

Sarge 08-25-2001 07:43 PM

i am on aol im
DLRArmyWebsite if you got a sec

Thanks in advance

Sarge 08-25-2001 08:12 PM

fixed it

Apparently when I downloaded the file before modifying it was screwed. IT had boxes instead of letters in certain areas.
Very weird.
Thanks

Admin 08-26-2001 05:51 AM

Sorry for not answering, I was sleeping. :o

Glad you fixed it. :)

Sarge 08-26-2001 08:38 PM

thanks bud

Kengan 08-27-2001 07:41 AM

cool hack ! I like it very much ! thanks man !

ying_ho 09-06-2001 04:55 PM

Help~

When I installed the hack, I got this error on the admin panal

Parse error: parse error in /home/hongkon/public_html/bbs/admin/functions.php on line 1956

Warning: Cannot add header information - headers already sent by (output started at /home/hongkon/public_html/bbs/admin/functions.php:1956) in /home/hongkon/public_html/bbs/admin/functions.php on line 1467

=========================

And I found that

Line 1956: smilies = $DB_site->query("SELECT title, smilietext, smiliepath FROM smilie ORDER BY showid");
Line 1467: setcookie($name,$value,$expire,$cookiepath);

What should I do?

Admin 09-06-2001 05:05 PM

Open your config.php file, and remove ANY whitespaces after the ?> and get back to me. :)

ying_ho 09-06-2001 06:28 PM

Thanks Buds. But there is no whitespaces behind <? in config.php.

Any other suggestion?

ying_ho 09-06-2001 06:34 PM

When I login to the admin panal, I got more errors.

Warning: Cannot add header information - headers already sent by (output started at /home/hongkon/public_html/bbs/admin/functions.php:1956) in /home/hongkon/public_html/bbs/admin/functions.php on line 1467

Warning: Cannot add header information - headers already sent by (output started at /home/hongkon/public_html/bbs/admin/functions.php:1956) in /home/hongkon/public_html/bbs/admin/functions.php on line 1467

Warning: Cannot add header information - headers already sent by (output started at /home/hongkon/public_html/bbs/admin/functions.php:1956) in /home/hongkon/public_html/bbs/admin/global.php on line 133

Warning: Cannot add header information - headers already sent by (output started at /home/hongkon/public_html/bbs/admin/functions.php:1956) in /home/hongkon/public_html/bbs/admin/global.php on line 159

====================================
Global.php
Line 133: setcookie("bbadminon",1,0,'/');
Line 159: setcookie("bbadminon",1,0,'/');


:confused: :confused: :confused:

Freddie Bingham 09-16-2001 03:04 PM

ying_ho please enter your license information into your profile.

YourHostSucks 09-30-2001 06:48 PM

Great again, you have alot of nice hacks..

Install was very easy, and it is working perfect! :D


All times are GMT. The time now is 10:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01442 seconds
  • Memory Usage 1,841KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (18)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete