tehcake
05-18-2005, 10:00 PM
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
SELECT iconid, iconpath, title
REPLACE WITH
SELECT iconid, iconpath, title, iconforums
FIND
while ($icon = $DB_site->fetch_array($icons))
{
ADD BELOW
$forumid = $foruminfo[forumid];
$forums = explode(',',$icon[iconforums]);
if (in_array($forumid,$forums))
{
FIND
eval('$posticonbits .= "' . fetch_template('posticonbit') . '";');
ADD BELOW
}
FINISH! Enjoy you're cleaner forums. :)
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
SELECT iconid, iconpath, title
REPLACE WITH
SELECT iconid, iconpath, title, iconforums
FIND
while ($icon = $DB_site->fetch_array($icons))
{
ADD BELOW
$forumid = $foruminfo[forumid];
$forums = explode(',',$icon[iconforums]);
if (in_array($forumid,$forums))
{
FIND
eval('$posticonbits .= "' . fetch_template('posticonbit') . '";');
ADD BELOW
}
FINISH! Enjoy you're cleaner forums. :)