View Single Post
  #308  
Old 02-25-2014, 08:22 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by midnz View Post
Hi Logician, I was wondering if you can solve my puzzle:

I'm using your default web query $WQ_last10threadfromforum2 but changed it to extract threads from forum#121 and it works as it should.
PHP Code:
SELECT threadidtitlepostusername,postuserid,dateline 
FROM 
" . TABLE_PREFIX . "thread 
WHERE sticky
=AND visible=AND forumid=121
ORDER BY dateline DESC
LIMIT 10 
I duplicated that web query ($WQ_last10threadfromforum3) and tried to extract the threads from forumid=230 but it didn't work. The resulting display was blank.
PHP Code:
SELECT threadidtitlepostusername,postuserid,dateline 
FROM 
" . TABLE_PREFIX . "thread 
WHERE sticky
=AND visible=AND forumid=230
ORDER BY dateline DESC
LIMIT 1 
... and so I executed an SQL Query and noticed the following error:
So, I did the same with the code that works as it should:
But that one does in fact display the last ten threads from forum#121.
I did try to read the 5.1.72 manual until my eyes crossed and fell out on to my cheeks.
Can you help please?

Logician's WebTemplates 4.0.2
MySQL Version - 5.1.72-cll
vB 4.2.2
You can't directly run these SQL queries in applications like phpmyadmin because it has a vbulletin replacement in it. (which is " . TABLE_PREFIX . " ).

So its NORMAL that BOTH of these queries will produce a syntax error when you try to run them "as they are" in tools like phpmyadmin. If you want to run them there, you need to remove " . TABLE_PREFIX . " part and use this query:


PHP Code:
SELECT threadidtitlepostusername,postuserid,dateline 
FROM thread 
WHERE sticky
=AND visible=AND forumid=230
ORDER BY dateline DESC
LIMIT 10 
or
PHP Code:
SELECT threadidtitlepostusername,postuserid,dateline 
 FROM thread 
 WHERE sticky
=AND visible=AND forumid=121
 ORDER BY dateline DESC
 LIMIT 10 
These should run fine in phpmyadmin.

However this still does not explain why your query is not running in webtemplates. I suspect there is another problem somewhere else rather than the query syntax. I don't know if your webmaster email in config.php file is accurate but if webquery died with a DB error (like syntax error) you would get a DB error notification in your email. Since you didn't get it, I'd think that there is no problem with your webquery.

Blank pages usually means PHP errors and they happen in servers where PHP error display is turned off in php.ini. If it was on, the page would display the error and we would have more clue. Since its off, I don't know what is causing the error but maybe you can check it in your server's php error log. I'd suspect something about the webtemplate your recently created (rather than webquery).

So my first suggestion is, create a new test webtemplate with nothing in it but a simple "hello there $WQ_last10threadfromforum3" and see if it will also produce a blank page. If it works, then you can understand its somehow related to the content of your other webtemplate (not webquery!). It might be clashing with an other plugin or smt.

It would really help if you enable php error display in server so that we'll see the error message that blank page is suppose to produce.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01413 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete