Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
a bit of code in need of fixing Details »»
a bit of code in need of fixing
Version: , by E E is offline
Developer Last Online: Mar 2008 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 04-02-2002 Last Update: Never Installs: 0
 
No support by the author.

part of a hack im making:

PHP Code:
 //Drakks Warning Hack
$warnifield="field10" //make x the field for ur warning level
$warnlevel $DB_site->query_first("SELECT $warnifield FROM userfield WHERE $userid=$bbuserinfo");
        if (
$warnlevel >= "10") {
                
$warnphraze="NEEDS BANNING";    //u may set the warn phraze for each one
        
} elseif ($warnlevel >= "7") {
                
$warnphraze="Very Bad";
        } elseif (
$warnlevel >= "4") {
                
$warnphraze="Thats Rough";
        } elseif (
$warnlevel >= "1") {
                
$warnphraze="Evil's Apprentice";
        } else {
                
$warnphraze"Goody Goody";
        }
        if (
$warnfield >= "10") {
                
$warning='<img src="{imagefolder}/warn1.jpg"> $warnphraze';
        } elseif (
$warnlevel >= "7") {
                
$warning='<img src="{imagefolder}/warn2.jpg"> $warnphraze';
        } elseif (
$warnlevel >= "4") {
                
$warning='<img src="{imagefolder}/warn3.gif"> $warnphraze';
        } elseif (
$warnlevel >= "1") {
                
$warning='<img src="{imagefolder}/warn4.gif"> $warnphraze';
        } else {
                
$warning='<img src="{imagefolder}/warn5.gif"> $warnphraze';
        }
//End Warning hack 
Theres also an error with the query,,, but... how can i get $warning too =<img src="{imagefolder}/warn5.gif"> and so on?

i know that Wont work.. how can i change it too make it work

Show Your Support

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

Comments
  #2  
Old 04-02-2002, 05:22 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you tried:
PHP Code:
$warning='<img src="{imagefolder}/warn1.jpg"> $warnphraze' 
?
Reply With Quote
  #3  
Old 04-02-2002, 05:25 AM
E's Avatar
E E is offline
 
Join Date: Mar 2002
Location: Fieldale Virginia
Posts: 421
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm...
Reply With Quote
  #4  
Old 04-02-2002, 05:41 AM
E's Avatar
E E is offline
 
Join Date: Mar 2002
Location: Fieldale Virginia
Posts: 421
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

theres still the error with this line :
PHP Code:
$warnlevel $DB_site->query_first("SELECT $warnfield FROM userfield WHERE userid='$bbuserinfo'"); 
i also tried changing it too:
PHP Code:
$warnlevel $DB_site->query_first("SELECT $warnfield FROM userfield WHERE userid=$userid"); 
Reply With Quote
  #5  
Old 04-02-2002, 07:26 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

insert:
echo "warnfield=$warnfield <br>";
echo "bbuserinfo=$bbuserinfo<br>";
before
$warnlevel = $DB_site->query_first("SELECT $warnfield FROM userfield WHERE userid='$bbuserinfo'");

and see what your variables have before entering the query.

BTW isnt it the variable "$bbuserinfo[userid]" you should use in your query if I got what you're trying to do right?

if yes try this:
$new_var_323= $bbuserinfo[userid];
$warnlevel = $DB_site->query_first("SELECT $warnfield FROM userfield WHERE userid='$new_var_323'");

Hope this helps..

Regards,
Logician
Reply With Quote
  #6  
Old 04-02-2002, 07:33 AM
E's Avatar
E E is offline
 
Join Date: Mar 2002
Location: Fieldale Virginia
Posts: 421
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it seems no matter what i do i get this error:

Parse error: parse error in /home/fiendwor/public_html/admin/functions.php on line 214

Fatal error: Call to undefined function: getuserinfo() in /home/fiendwor/public_html/admin/sessions.php on line 323
Reply With Quote
  #7  
Old 04-02-2002, 07:36 AM
E's Avatar
E E is offline
 
Join Date: Mar 2002
Location: Fieldale Virginia
Posts: 421
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it doesnt like this code:
echo "warnfield=$warnfield <br>";

if thats not there it doesnt like this code:
$new_var_323= $bbuserinfo[userid];

if thats not there it doesnt like the query
Reply With Quote
  #8  
Old 04-02-2002, 07:48 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what editor program do you use? Cant you see which line produced the error? I strongly suggest you using an editor that can show you line numbers and then you can easily point which line is causing you trouble. It would be a real headache to trace and fix the problem without even knowing which line causes the problem!
Reply With Quote
  #9  
Old 04-02-2002, 07:52 AM
E's Avatar
E E is offline
 
Join Date: Mar 2002
Location: Fieldale Virginia
Posts: 421
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
//Drakks Warning Hack
$warnfield="field10" //make x the field for ur warning level
echo "warnfield=$warnfield <br>";
echo 
"bbuserinfo=$bbuserinfo<br>";

$warnlevel $DB_site->query_first("SELECT $warnfield FROM userfield WHERE userid='$new_var_323'");
$warnlevel=$warnlevel[$warnfield]; 
in that case this is the line:
PHP Code:
echo "warnfield=$warnfield <br>"
if u get rid of that and the bit after it and this is in there this is the line:
PHP Code:
$new_var_323$bbuserinfo[userid]; 
but.. if that aint there this is the line:
PHP Code:
$warnlevel $DB_site->query_first("SELECT $warnfield FROM userfield WHERE $bbuserinfo[userid]"); 
and so on
Reply With Quote
  #10  
Old 04-02-2002, 08:00 AM
E's Avatar
E E is offline
 
Join Date: Mar 2002
Location: Fieldale Virginia
Posts: 421
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

o and the first line of this bit of code is the reference too the sessions.php
PHP Code:
  // get pertinient user info
  
if (!isset($bbuserinfo) or $bbuserinfo['userid']!=$session['userid']) {
    
$bbuserinfo=getuserinfo($session['userid']);
    
$bbuserinfo['realstyleid'] = $bbuserinfo['styleid'];
  } 
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 12:06 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.04300 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
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
  • (9)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete