Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Posticons exlusive to forums. NO STYLE editing!!! Details »»
Posticons exlusive to forums. NO STYLE editing!!!
Version: 0.1, by tehcake tehcake is offline
Developer Last Online: Jul 2005 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 05-18-2005 Last Update: Never Installs: 3
DB Changes
Code Changes Additional Files Is in Beta Stage  
No support by the author.

This has been done before, but I've yet to see it released here. I was desperate to have this for my forums which has a lot of posticons.

This hack allows you to make posticons useable in only forums you specify. I'm no PHP expert, and I find it amazing how I pulled this off (Had a little help from someone to get it working correctly.), so you won't be able to set the settings through admincp yet. Instead, you have to manually do some changse in your MySQL database for each posticon.

Step 1 MySQL
First, you'll have to go to the icon table in your MySQL database. Create a field called iconforums in the table. Then edit each posticon (phpMyAdmin you'll have to click on the BROWSE tab in the table to edit the fields.), add the forumids to the iconforums field, seperating each forumid with only a comma.

Step 2
Now you'll have to edit your includes/functions_newpost.php.
FIND
Code:
		SELECT iconid, iconpath, title
REPLACE WITH
Code:
		SELECT iconid, iconpath, title, iconforums

FIND
Code:
	while ($icon = $DB_site->fetch_array($icons))

	{
ADD BELOW
Code:
	$forumid = $foruminfo[forumid];
		$forums = explode(',',$icon[iconforums]);
		if (in_array($forumid,$forums))
		{
FIND
Code:
			eval('$posticonbits .= "' . fetch_template('posticonbit') . '";');
ADD BELOW
Code:
}
FINISH! Enjoy you're cleaner forums.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-19-2005, 05:47 AM
Blackbeard Blackbeard is offline
 
Join Date: Mar 2003
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry stupid Q but do you have a screenie of this one please.
Reply With Quote
  #3  
Old 05-19-2005, 05:59 AM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you know when u create a thread or post?
u have the icons u can use for that thread or post

this makes it so some icons will only show up in certain forums and hence can only be used in those forums

i have the perfect use for this, a coding forum where there are icons based on what code your thread is about
i find people using those icons in off topic :/

thanks
Reply With Quote
  #4  
Old 05-19-2005, 06:25 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to do this per style instead of using replacements (which is what I'm currently doing)?
Reply With Quote
  #5  
Old 05-19-2005, 06:32 AM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

perhaps, i have the wrong format for iconforums?
nothing is showing up

perhaps its this line?
PHP Code:
  `iconforumsvarchar(100NOT NULL default ''

PHP Code:
CREATE TABLE `icon` (
  `
iconidsmallint(5unsigned NOT NULL auto_increment,
  `
iconforumsvarchar(100NOT NULL default '',
  `
titlevarchar(100NOT NULL default '',
  `
iconpathvarchar(100NOT NULL default '',
  `
imagecategoryidsmallint(5unsigned NOT NULL default '0',
  `
displayordersmallint(5unsigned NOT NULL default '1',
  
PRIMARY KEY  (`iconid`)
TYPE=MyISAM AUTO_INCREMENT=22 ;

-- 
-- 
Dumping data for table `icon`
-- 

INSERT INTO `iconVALUES (1'2,3,4,5,6,7,8,10,11,12,13,14,15''News''images/icons/icon1.gif'41);
INSERT INTO `iconVALUES (2'2,3,4,5,6,7,8,10,11,12,13,14,15''Read This''images/icons/icon2.gif'41);
INSERT INTO `iconVALUES (3'2,3,4,5,6,7,8,10,11,12,13,14,15''Idea''images/icons/icon3.gif'221);
INSERT INTO `iconVALUES (4'2,3,4,5,6,7,8,10,11,12,13,14,15''Important!''images/icons/icon4.gif'230);
INSERT INTO `iconVALUES (5'2,3,4,5,6,7,8,10,11,12,13,14,15''Question''images/icons/icon5.gif'220);
INSERT INTO `iconVALUES (6'2,3,4,5,6,7,8,10,11,12,13,14,15''Cool''images/smilies/cool.gif'210);
INSERT INTO `iconVALUES (7'2,3,4,5,6,7,8,10,11,12,13,14,15''Smile''images/smilies/smile.gif'26);
INSERT INTO `iconVALUES (8'2,3,4,5,6,7,8,10,11,12,13,14,15''Angry''images/smilies/mad.gif'29);
INSERT INTO `iconVALUES (9'2,3,4,5,6,7,8,10,11,12,13,14,15''Unhappy''images/smilies/frown.gif'28);
INSERT INTO `iconVALUES (10'2,3,4,5,6,7,8,10,11,12,13,14,15''Big Smile''images/smilies/biggrin.gif'210);
INSERT INTO `iconVALUES (11'2,3,4,5,6,7,8,10,11,12,13,14,15''Red face''images/smilies/redface.gif'210);
INSERT INTO `iconVALUES (12'2,3,4,5,6,7,8,10,11,12,13,14,15''Wink''images/smilies/wink.gif'27);
INSERT INTO `iconVALUES (13'2,3,4,5,6,7,8,10,11,12,13,14,15''Thumbs down''images/icons/icon13.gif'225);
INSERT INTO `iconVALUES (14'2,3,4,5,6,7,8,10,11,12,13,14,15''Thumbs up''images/icons/icon14.gif'226);
INSERT INTO `iconVALUES (15'2,3,4,5,6,7,8,10,11,12,13,14,15''Very Important!''images/buttons/report.gif'41);
INSERT INTO `iconVALUES (16'2,3,4,5,6,7,8,10,11,12,13,14,15''Extremely Important!''images/icons/important.gif'44); 
any ideas on the proper row structure?

ps, heres the code
as u can see its exactly as ur instructions say...

PHP Code:
    // original SELECT iconid, iconpath, title
    
$icons $DB_site->query("
        SELECT iconid, iconpath, title, iconforums
        FROM " 
TABLE_PREFIX "icon AS icon
        WHERE imagecategoryid NOT IN (0
$badcategories)
        ORDER BY imagecategoryid, displayorder
    "
);

    if (!
$DB_site->num_rows($icons))
    {
        return 
false;
    }

    
$numicons 0;
    
$show['posticons'] = false;

    while (
$icon $DB_site->fetch_array($icons))
    {
    
// hack 
    
$forumid $foruminfo[forumid];
        
$forums explode(',',$icon[iconforums]);
        if (
in_array($forumid,$forums))
        {
    
// hack end
        
$show['posticons'] = true;
        if (
$numicons == AND $numicons != 0)
        {
            
$posticonbits .= "</tr><tr><td>&nbsp;</td>";
        }

        
$numicons++;

        
$iconid $icon['iconid'];
        
$iconpath $icon['iconpath'];
        
$alttext $icon['title'];
        if (
$seliconid == $iconid)
        {
            
$iconchecked HTML_CHECKED;
            
$selectedicon = array('src' => $iconpath'alt' => $alttext);
        }
        else
        {
            
$iconchecked '';
        }

        eval(
'$posticonbits .= "' fetch_template('posticonbit') . '";');
        
// hack
        
}
        
// hack end

    

Reply With Quote
  #6  
Old 05-19-2005, 10:37 AM
boo.3 boo.3 is offline
 
Join Date: Nov 2004
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screen shot?
Reply With Quote
  #7  
Old 05-19-2005, 02:05 PM
tehcake tehcake is offline
 
Join Date: Mar 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry Jenta, but I'm not really a PHP/MySQL person, so I went into phpMyAdmin and did it all by hand instead of using a query. I don't know if it's the problem, but maybe it's the CREATE part because the icon table already exists?
Reply With Quote
  #8  
Old 05-19-2005, 03:52 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not bad yes, but could you put instruction in a .txt file, please

You have no image has to be proposed with this hack also ?
Reply With Quote
  #9  
Old 05-19-2005, 04:44 PM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tehcake
Sorry Jenta, but I'm not really a PHP/MySQL person, so I went into phpMyAdmin and did it all by hand instead of using a query. I don't know if it's the problem, but maybe it's the CREATE part because the icon table already exists?
the create code is just my dump of the table, i didnt use it to actually add ur row
its only to show the rows and what is in each



PHP Code:
`iconforumsvarchar(100NOT NULL default ''
this is the row you say to create
can you look at yours and see if its the same?
Reply With Quote
  #10  
Old 05-19-2005, 04:47 PM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

argh, no automerge double post

anyways....

for those wanting an image, heres one straight from this forum
these are post icons
this hack lets u set which forum each post icon will appear in
its the same as setting an icon category that only certain usergroups can use but its forum bases instead of usergroup based


here's a scenario that might help some understand

lets say you run a decorating forum with different forums

one forum is for gardens and stuff
you have post icons like - rakes and wheelbarrows

then you have another forum about kitchens
you have icons like - cups and refrigerators

then u have a forum where people talk about everyday life - off topic
u dont want the cups, refrigirators, rakes or wheelbarrrow appearing there

opps, just say he added some icons
nm
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:26 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.05017 seconds
  • Memory Usage 2,347KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete