Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post
Post Hide + Hide2 
 
I would like to have two different kinds of BBcode hide.
The regular one, and the customized "hide2 bbcode".

The second one should be viewable if you are logged in, so every registered user can see the message. Al guests still get a message they should register!

Someone knows how to do this?
I tried to add "hide2" by copying all hide-functions, but this did not seem to work...


The default code in includes/bbcode.php:
Code: [Download] [Hide]
  1. // HIDE  
  2.         if($tag === 'hide')  
  3.         {  
  4.             if($this->is_sig && !$board_config['allow_all_bbcode'])  
  5.             {  
  6.                 return $error;  
  7.             }  
  8.             if($item['iteration'] > 1)  
  9.             {  
  10.                 return $error;  
  11.             }  
  12.             global $db, $topic_id, $mode;  
  13.             $show = false;  
  14.             if(defined('IS_ICYPHOENIX') && $userdata['session_logged_in'])  
  15.             {  
  16.                 $sql = "SELECT p.poster_id, p.topic_id  
  17.                     FROM " . POSTS_TABLE . " p  
  18.                     WHERE p.topic_id = $topic_id  
  19.                     AND p.poster_id = " . $userdata['user_id'];  
  20.                 $resultat = $db->sql_query($sql);  
  21.                 $show = $db->sql_numrows($resultat) ? true : false;  
  22.                 $db->sql_freeresult($result);  
  23.  
  24.                 $sql = "SELECT *  
  25.                     FROM " . THANKS_TABLE . "  
  26.                     WHERE topic_id = $topic_id  
  27.                     AND user_id = " . $userdata['user_id'];  
  28.                 $resultat = $db->sql_query($sql);  
  29.                 $show = ($db->sql_numrows($resultat) || ($show == true))? true : false;  
  30.                 $db->sql_freeresult($result);  
  31.  
  32.                 if (($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD))  
  33.                 {  
  34.                     $show = true;  
  35.                 }  
  36.             }  
  37.             // generate html  
  38.             $html = '<div>';  
  39.             if(!$show)  
  40.             {  
  41.                 return array(  
  42.                     'valid' => true,  
  43.                     'html' => $html . $lang['xs_bbc_hide_message_explain'] . '</div>',  
  44.                     'allow_nested' => false,  
  45.                 );  
  46.             }  
  47.             else  
  48.             {  
  49.                 return array(  
  50.                     'valid' => true,  
  51.                     'start' => $html,  
  52.                     'end' => '</div>'  
  53.                 );  
  54.             }  
  55.         }  
  56.  



I think this code should be changed...
if (($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD))


Thanks in advance!
 



 
OwnageWorldSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events