Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
User rights for Smilies Details »»
User rights for Smilies
Version: 1.00, by leonsio leonsio is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 09-29-2005 Last Update: Never Installs: 1
 
No support by the author.

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 !! )
Code:
        $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

Code:
// 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

Code:
                        // 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

Code:
// 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

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

replace

Code:
// 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 )

Code:
print_stop_message('smilie_categories_dont_support_permissions');
replace

Code:
#print_stop_message('smilie_categories_dont_support_permissions');
find

Code:
                                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

Code:
                                #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

Show Your Support

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

Comments
  #2  
Old 09-30-2005, 10:17 AM
theArchitect's Avatar
theArchitect theArchitect is offline
 
Join Date: Sep 2004
Location: Sydney
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 09-30-2005, 10:56 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If they type the replace code for the smilies won't it still parse though?
Reply With Quote
  #4  
Old 09-30-2005, 12:07 PM
leonsio leonsio is offline
 
Join Date: Jun 2002
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont found other places for changes which has hooks :/

but you can deaktivate this hack in admincp
and you will see all smilies
Reply With Quote
  #5  
Old 09-30-2005, 10:10 PM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PM me when you have a plugin for it
Reply With Quote
Reply


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 02:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07542 seconds
  • Memory Usage 2,248KB
  • Queries Executed 18 (?)
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
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete