Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 08-21-2004, 03:04 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
$journal_views = $DB_site->query("
							SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views
							FROM journal j
							LEFT JOIN user u ON u.userid = j.userid
							WHERE j.enabled = 1
							ORDER BY j.views DESC
							LIMIT " . "$vboptions[journals_viewdisplaylimit]
							");
that' it... thank you so much
Reply With Quote
  #12  
Old 08-21-2004, 03:07 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could you try replacing it with this, and telling me what happens then?

Code:
$journal_views = $DB_site->query("
							SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views
							FROM journal j
							LEFT JOIN user u ON u.userid = j.userid
							WHERE j.enabled = 1
							ORDER BY j.views DESC
							LIMIT $vboptions['journals_viewdisplaylimit']
							");
Thanks.
Reply With Quote
  #13  
Old 08-21-2004, 03:08 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i get this error:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/exas77ko/public_html/forum/journal.php on line 1211
Reply With Quote
  #14  
Old 08-21-2004, 03:09 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this instead:

PHP Code:
$limit_views intval($vboptions['journals_viewdisplaylimit']);
$journal_views $DB_site->query("SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views FROM journal j LEFT JOIN user u ON u.userid = j.userid WHERE j.enabled = 1 ORDER BY j.views DESC LIMIT" $limit_views); 
Reply With Quote
  #15  
Old 08-21-2004, 03:11 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, brad.loo to save the day.

edit. hey brad.loo, maybe you could help with my problem :devious: look about 10 threads down lol.
Reply With Quote
  #16  
Old 08-21-2004, 03:12 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brad.loo
Try this instead:

PHP Code:
$limit_views intval($vboptions['journals_viewdisplaylimit']);
$journal_views $DB_site->query("SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views FROM journal j LEFT JOIN user u ON u.userid = j.userid WHERE j.enabled = 1 ORDER BY j.views DESC LIMIT" $limit_views); 
when i did that, i got this error

Database error in vBulletin 3.0.0:

Invalid SQL: SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views FROM journal j LEFT JOIN user u ON u.userid = j.userid WHERE j.enabled = 1 ORDER BY j.views DESC LIMIT0
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT0' at line 1

mysql error number: 1064
Reply With Quote
  #17  
Old 08-21-2004, 03:13 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Argh...damn array, use this:

PHP Code:
$journal_views $DB_site->query("SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views FROM journal j LEFT JOIN user u ON u.userid = j.userid WHERE j.enabled = 1 ORDER BY j.views DESC LIMIT"  $vboptions['journals_viewdisplaylimit']); 
Reply With Quote
  #18  
Old 08-21-2004, 03:20 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Database error in vBulletin 3.0.0:

Invalid SQL: SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views FROM journal j LEFT JOIN user u ON u.userid = j.userid WHERE j.enabled = 1 ORDER BY j.views DESC LIMIT
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

mysql error number: 1064

Date: Saturday 21st of August 2004 12:19:31 AM
Script: http://www.exasko.info/forum/journal.php
thats the error i get when made the other change
Reply With Quote
  #19  
Old 08-21-2004, 03:25 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wait, is the the journal script posted on evB? Last I heard that has alot more errors then just then one, just so you know.

You can try throwing this at it, are you sure you set up all the vBoptions for that script correctly?

PHP Code:
$journal_views $DB_site->query("SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views FROM journal j LEFT JOIN user u ON u.userid = j.userid WHERE j.enabled = 1 ORDER BY j.views DESC LIMIT".$vboptions[journals_viewdisplaylimit]); 
Altho im not sure why the single quotes in the array would throw it off any.
Reply With Quote
  #20  
Old 08-21-2004, 04:21 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no.. didn't fixc the problem
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 02:20 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.04481 seconds
  • Memory Usage 2,256KB
  • 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
  • (2)bbcode_code
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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