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

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-27-2000 Last Update: Never Installs: 0
 
No support by the author.

I'm writing a hack (ha! If you can even call it that - I'm not that talented)...and basically, I'd like to use SQL queries in the same format as vBulletin - since that seems to be the most logical thing to do...however, I can't get it to display more than one entry...any advice? I'll obviously need a while loop, but I'm not sure how to format it...

Here's what I have (which produces an error):

Code:
$query2=$DB_site->query_first("SELECT * FROM savethreads WHERE saveuser='$username'");
$result = mysql_query($query2,$DB_site);
while ($row = mysql_fetch_array($result)) {
	$savethreadid = $row["savethreadid"];
echo("$savethreadid");
Any thoughts?

Oh, also: I've created a custom template which is pulled onto a custom PHP page in my forums directory (thanks JimF! )...however the template displays first, with all my queries and their results below it all - how can I stick it in the middle of the template? I don't recall seeing actual queries used in any of the other templates...so I know there must be some other way.

Thanks!

Show Your Support

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

Comments
  #2  
Old 09-27-2000, 01:25 AM
Guest
 
Posts: n/a
Default

Code:
$query2=$DB_site->query("SELECT * FROM savethreads WHERE saveuser='$username'");
while ($row = $DB_site->fetch_array($result)) {
	$savethreadid = $row["savethreadid"];
echo("$savethreadid");
}
Reply With Quote
  #3  
Old 09-27-2000, 10:01 PM
Guest
 
Posts: n/a
Default

Thanks Ed - very cool.

Anyone got any thoughts on the template problem? I'll bet the answer is simple - yet it escapes me somehow.
Reply With Quote
  #4  
Old 09-27-2000, 10:07 PM
Guest
 
Posts: n/a
Default

Uh...the other thing still doesn't work I'm afraid:

Warning: Supplied argument is not a valid MySQL result resource in /usr/home/webdev/mycoding/spunkyjunk.com/docs/testboard/admin/db_mysql.php on line 82

Using this code:

Code:
$query2=$DB_site->query("SELECT * FROM savethreads WHERE saveuser='$username'");
while ($row = $DB_site->fetch_array($result)) {
	$savethreadid = $row["savethreadid"];
echo("$savethreadid");
}
Reply With Quote
  #5  
Old 09-27-2000, 10:28 PM
Guest
 
Posts: n/a
Default

You need to replace $result with $query2
Reply With Quote
  #6  
Old 09-28-2000, 12:11 AM
Guest
 
Posts: n/a
Default

Oops, sorry 'bout that - thanks rangers.
Reply With Quote
  #7  
Old 09-28-2000, 12:25 AM
Guest
 
Posts: n/a
Default

Bingo! My mistake - still have a bit to learn about PHP's interaction with SQL (obviously)

Anyone else got the info on my template problem? It's one of the last hurdles in finishing the hack!
Reply With Quote
  #8  
Old 09-28-2000, 10:51 AM
Guest
 
Posts: n/a
Default

Hmmm...maybe I'll be forced to figure it out myself, hehe.

It's okay - I can handle it! I hope!
Reply With Quote
  #9  
Old 09-28-2000, 01:56 PM
Guest
 
Posts: n/a
Default

Post the code you have for your template.
Reply With Quote
  #10  
Old 09-28-2000, 02:42 PM
Guest
 
Posts: n/a
Default

Here's a new template I've created for one of the pages used in my hack:

Code:
{htmldoctype}
<HTML>
<HEAD><TITLE>$pagetitle</title>
$cssinclude
$headinsert
</head>
<body>
$header

<table border="0" width="100%"><tr>
<td valign="top" align="left"><a href="index.php"><img src="$titleimage" border="0"></a></td>

<td valign="middle" align="center" nowrap>
$fivelinks
</td></tr></table>

<table border=0 cellpadding=4 cellspacing=1 width=100%>
<tr bgcolor="{tableheadbgcolor}"><TD width="100%">

<normalfont color="{tableheadtextcolor}" class=thtcolor><B>vBulletin Message</B></normalfont>

</td></tr>
<tr bgcolor="{firstaltcolor}"><td width="100%">
WANT STUFF TO GO RIGHT HERE!</td></tr></table>

<p align="center">$forumjump</p>

$footer

</body>
</html>
Obviously I want to put all my SQL queries and echo statements right where "WANT STUFF TO GO RIGHT HERE!" is...but how can I do that in the template? For the other templates on the script I see variables in that spot...$errormessage, or the like. I have an idea of how to do this, but definetly need some help!
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 10:30 AM.


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.06542 seconds
  • Memory Usage 2,271KB
  • 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
  • (4)bbcode_code
  • (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_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
  • 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