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

Reply
 
Thread Tools
help me smash this bug Details »»
help me smash this bug
Version: , by N!ck N!ck is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

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

Does anyone see anything wrong with this query? ::

Code:
      $newforuminfo=$DB_site->query("SELECT forum.*,postthanks.* FROM forum LEFT JOIN postthanks ON (forum.forumid=postthanks.postthanksid) WHERE forumid='".$foruminfo[forumid]."'");
When I put $newforuminfo[message] in the template, the variable appears to not be set (it's blank).

This is for a hack I'm making, so anyone who can help me out will get credit.

Thanks.

Show Your Support

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

Comments
  #2  
Old 10-08-2002, 02:21 AM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

btw, i've got a table called "postthanks" that i'm trying to join. that table contains a field called "message", which is what i'm trying to retrieve.
Reply With Quote
  #3  
Old 10-08-2002, 11:56 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

don't use query if you want to work with the variable, you have to use query_first:
Code:
$newforuminfo=$DB_site->query_first("SELECT forum.*,postthanks.* FROM forum LEFT JOIN postthanks ON (forum.forumid=postthanks.postthanksid) WHERE forumid='".$foruminfo[forumid]."'");
Reply With Quote
  #4  
Old 10-08-2002, 12:57 PM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah, thank you very much!
Reply With Quote
  #5  
Old 10-08-2002, 01:14 PM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i guess that wasn't the *only* problem. i'm going to call this a failed project before i have too much time invested.
Reply With Quote
  #6  
Old 10-08-2002, 01:24 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well it depends on where's the template read out.

if you use standartredirect with $newforuminfo[postthanks] it won't work, because $newforuminfo isn't a global var...

am i right?

if yes you have to open admin/functions.php
find
PHP Code:
// ###################### Start standardredirect( #######################
function standardredirect($message="",$url="") {
  
// print standard redirect page

  
global $header,$footer,$headinclude,$headnewpm,$toplinks,$forumjump,$timezone,$bbtitle,$hometitle,$bburl,$homeurl,$copyrighttext,$privacyurl,$contactuslink,$webmasteremail,$technicalemail,$faxnumber,$address,$companyname,$titleimage,$replyimage,$newthreadimage,$closedthreadimage,$lastvisitdate,$timenow,$session;

  
$title=$bbtitle;

  
$pagetitle "$title";
  
$errormessage $message;

  
$url str_replace("\""""$url);

  eval(
"dooutput(\"".gettemplate("standardredirect")."\");");
  exit;


and add $newforuminfo into the global line
Reply With Quote
  #7  
Old 10-08-2002, 09:46 PM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mmm! yes! i'm glad i didn't toss the readme file yet...i'm gonna re-apply this hack and try that. thanks.
Reply With Quote
  #8  
Old 10-08-2002, 11:16 PM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:/ still isn't cooperating. if it's not a huge deal, maybe i could send you the hack so you could take a look at the file edits and see what might be wrong. if it is, that's fine. i've pretty much given up anyway.
Reply With Quote
  #9  
Old 10-09-2002, 09:46 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no problem, send per pm, i'll see what i can do
Reply With Quote
  #10  
Old 10-09-2002, 12:54 PM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
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 11:06 PM.


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.10107 seconds
  • Memory Usage 2,290KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete