vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   if() vBCode - Private Post Text Hack (https://vborg.vbsupport.ru/showthread.php?t=48492)

NuclioN 02-04-2003 01:51 PM

You can add a bg image in the style with:

BACKGROUND-IMAGE: url("http://www.yoursite.com/images/some-image.gif");

;)

Slynderdale 02-04-2003 02:04 PM

Heres a neat little piece of code:

[if($ourtimenow>=$post[dateline]+((7*24)*60*60))]Text To Display 1 week from this post[/if]

Dean C 02-04-2003 03:34 PM

Nice hack buddy :)

- miSt

Slynderdale 02-05-2003 07:06 AM

I am proud to say, after alot of testing, that this hack is out of beta and is safe to use, enjoy.

Link14716 02-05-2003 10:44 AM

With your new code, I get this error:
Code:

Fatal error: Call to undefined function: get_defined_functions() in /home/sites/site68/web/forums/admin/functions.php on line 854

Slynderdale 02-05-2003 12:45 PM

Quote:

Originally posted by Link14716
With your new code, I get this error:
Code:

Fatal error: Call to undefined function: get_defined_functions() in /home/sites/site68/web/forums/admin/functions.php on line 854


Hmm you must have an older version of php, you can comment that section out for now and only allow admins to use it and ill see f i can make a fix for it when i get back from classes.

Slynderdale 02-05-2003 01:13 PM

Quote:

Originally posted by Link14716
With your new code, I get this error:
Code:

Fatal error: Call to undefined function: get_defined_functions() in /home/sites/site68/web/forums/admin/functions.php on line 854

ok, try changing your doif function to this, it wont remove the functions but it will remove the ( ) from the code instead and that should disable any functions in the code.

PHP Code:

// ###################### Do IF #######################
function doif($code,$text,$output=0) {
  
extract ($GLOBALS);
  
  
//Editable Options Below
  
$admin_only false//Set to true if you want only admins to use this.
  
$admin_view_all false//Set to true if you want to allow admins to view all text.
  //Editable Options Above
  
  
$postadmin false;
  if (
$post['usergroupid']==or $postinfo['usergroupid']==6)  $postadmin true;
  
$isadmin false;
  if (
$bbuserinfo['usergroupid']==6)  $isadmin true;
  if (
$code and (!$admin_only or $admin_only and $postadmin)) { 
      unset(
$codestuff);
    while (list(
$key,$val)=each($bbuserinfo)) {
      
$codestuff .= '$bb'.strtolower($key).' = "'.$val.'";';
      @
define("bb".strtolower($key),$val,true);
    }
    @eval(
$codestuff);
    
$code str_replace("(","",$code);
    
$code str_replace(")","",$code);
    @eval (
'if ('.stripslashes($code).') { $eval_code= "1"; } else { $eval_code= "0"; }');
     if (
$eval_code or $bbuserinfo['userid'] == ($post['userid'] or $postinfo['userid']) or ($isadmin and $admin_view_all)) {
         if (!
$output) {
           return 
"<table border=\"0\" align=\"center\" width=\"90%\" cellpadding=\"3\" cellspacing=\"1\"><tr><td><smallfont><b>Private Text: ".iif($isadmin,"(".stripslashes($code).")","")."</b></smallfont></td></tr><tr><td class=\"privatetext_style\">".bbcodeparse($text)."</td></tr></table>";
        } else return 
"[if(".stripslashes($code).")]".$text."[/if]";
     } else {
       return 
"";
     }
  }
  if (
$admin_only and !$postadmin) return "[if(".stripslashes($code).")]".$text."[/if]";
  else return 
bbcodeparse($text);



Link14716 02-05-2003 07:09 PM

Meh, I'll just use the old version set to admins only. That is, until my PHP version is FINALLY upgraded.

Slynderdale 02-05-2003 09:37 PM

Quote:

Originally posted by Link14716
Meh, I'll just use the old version set to admins only. That is, until my PHP version is FINALLY upgraded.
I sent you a PM about it.

Erwin 02-05-2003 09:44 PM

This is great work. :) Well done! Obviously, use it with care - I would restrict this only for yourself - too easy to be abused or cause db errors by accident. :)


All times are GMT. The time now is 06:28 AM.

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.01295 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete