PDA

View Full Version : User rights for Smilies


leonsio
09-29-2005, 10:00 PM
what this hack do,
you can define rights for smilies, like posticons
for example you can give registerd users right zu access all smilies, unregistred or not loged user can use only default smilies


installation: easy

4 plugins ( 1 product )
4 file change


import the XML file, with product importer

in the misc.php

find ( on 2 positions !! )

$smilies = $db->query_read("
SELECT smilietext AS text, smiliepath AS path, smilie.title, smilieid,
imagecategory.title AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder
");


replace


// Smilies for Usergroups Hack BEGIN

$smilies = $db->query_read("
SELECT smilietext AS text, smiliepath AS path, smilie.title, smilieid,
imagecategory.title AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
WHERE imagecategory.imagecategoryid NOT IN (0$badcategories)
ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder
");

// Smilies for Usergroups Hack END




include/functions_editor.php

find


// query smilies
$smilies = $vbulletin->db->query_read("
SELECT smilieid, smilietext, smiliepath, smilie.title,
imagecategory.title AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder
")


replace


// Smilies for Usergroups Hack BEGIN

// query smilies
$smilies = $vbulletin->db->query_read("
SELECT smilieid, smilietext, smiliepath, smilie.title,
imagecategory.title AS category
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
WHERE imagecategory.imagecategoryid NOT IN (0$badcategories)
ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder
");

// Smilies for Usergroups Hack END



includes/class_bbcode.php

find


$smilies = $this->registry->db->query_read("
SELECT *, LENGTH(smilietext) AS smilielen
FROM " . TABLE_PREFIX . "smilie
ORDER BY smilielen DESC
");



replace


// Smilies for Usergroups Hack BEGIN

$badcategories= construct_smilies();

$smilies = $this->registry->db->query_read("
SELECT *, LENGTH(smilie.smilietext) AS smilielen
FROM " . TABLE_PREFIX . "smilie AS smilie
LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid)
WHERE imagecategory.imagecategoryid NOT IN (0$badcategories)
ORDER BY smilielen DESC
");

// Smilies for Usergroups Hack END





admincp/image.php

find ( on 2 positions )


print_stop_message('smilie_categories_dont_support _permissions');


replace


#print_stop_message('smilie_categories_dont_suppor t_permissions');


find

iif($category['imagetype'] != 3,
construct_link_code(
$vbphrase["{$itemtype}_permissions"], "image.php?"
. $vbulletin->session->vars['sessionurl']
. "do=editpermissions"
. "&table=" . $vbulletin->GPC['table']
. "&imagecategoryid=" . $category['imagecategoryid']
)
, ''
);


replace


#iif($category['imagetype'] != 3,
construct_link_code(
$vbphrase["{$itemtype}_permissions"], "image.php?"
. $vbulletin->session->vars['sessionurl']
. "do=editpermissions"
. "&table=" . $vbulletin->GPC['table']
. "&imagecategoryid=" . $category['imagecategoryid']
)
;# , ''
#);



done


dont forget, VB 3.5 has post cache, this modification works for new posts or posts which are not in the cache

theArchitect
09-30-2005, 10:17 AM
Nice idea. I am all for adding little extras for special members.

Though, is it possible to accomplish these file edits via another plug-in or similar?

Cyricx
09-30-2005, 10:56 AM
If they type the replace code for the smilies won't it still parse though?

leonsio
09-30-2005, 12:07 PM
i dont found other places for changes which has hooks :/

but you can deaktivate this hack in admincp
and you will see all smilies ;)

Daniel
09-30-2005, 10:10 PM
PM me when you have a plugin for it :)