Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-06-2002, 05:02 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With the following code i try 2 get the awards out of the database, when i have one award like this one:

awardsid=19 and aw=19 then it shows it on the postbit

now when i add a second award with these variables:

awardsid=16 and aw=0 then nothing will be showed, the first award will be ignored

when i change the second award to awardsid=16 and aw=16 then it shows that second award on the postbit...

so when i add a second award then it fully ignores the first entry/award :noid:

Does someone have a solution for this problem because i get paranoid

I'm using this code:

PHP Code:
if ($post[award]=="1"
   {
     
$awards=$DB_site->query("SELECT aw,awardsid,name, url FROM award");
     while (
$award=$DB_site->fetch_array($awards)) {
     if (
$award[aw] == $award[awardsid]) {
        eval(
"\$post[hasaward] = \"".gettemplate("awards")."\";");
    } 
else {
     
$post[hasaward]="nope";
     } 
}

Reply With Quote
  #2  
Old 02-06-2002, 05:27 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure I follow you, at all, but try changing this:
PHP Code:
        eval("\$post[hasaward] = \"".gettemplate("awards")."\";"); 
to this:
PHP Code:
        eval("\$post[hasaward] .= \"".gettemplate("awards")."\";"); 
since you are ADDING to the current variable, not re-creating it.
Reply With Quote
  #3  
Old 02-06-2002, 05:35 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are a lifesaver, thanks man.
Reply With Quote
  #4  
Old 02-13-2002, 01:54 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm..how spooky is this? I got the hack almost finished and now the code dont works anymore, i'm using this code at the moment:

PHP Code:
if ($post[award]=="1"
   {
     
$awards=$DB_site->query("SELECT * FROM useraward where userid=$post[userid]");
     while (
$award=$DB_site->fetch_array($awards)) 
     {
          if (
$award[awardsid] == $award[aw]) 
          {
             eval(
"\$post[hasaward] .= \"".gettemplate("awards")."\";");
          } else {
           
$post[hasaward]="";
          } 
     }
   } 
I have currently 3 awards in the database.

Lesane = checked
Lala = checked
Cool = not checked

It must display lesane + lala because they are checked but it displays nothing, it listen only to cool. When i have cool = checked then it displays everything so the script listen again only to the last entry in the database


Do you see any problem in the code that i dont see or do you know an other way? Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:32 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.07583 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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