Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2003, 02:23 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Questions

Does anyone know how to do this:

www.diyaudio.com

I want to show the last 20 posts like they have. They gave me this SQL syntex:
-----------------------------------------------------

SELECT t.threadid,
t.title,
t.lastposter,
t.replycount,
t.views,
t.forumid,
f.title,
t.lastpost

FROM thread AS t,
forum AS f

WHERE t.forumid = f.forumid
ORDER BY t.lastpost DESC
LIMIT 30

-----------------------------------------------------

How can i implement this into my php page? So i can show the information? Thanks in advance
Reply With Quote
  #2  
Old 03-21-2003, 04:58 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does anyone know?
Reply With Quote
  #3  
Old 03-21-2003, 05:15 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Crude but shows you how:
PHP Code:
echo "<pre>";
$result mysql_query("SELECT t.threadid,
t.title,
t.lastposter,
t.replycount,
t.views,
t.forumid,
f.title,
t.lastpost

FROM thread AS t,
forum AS f

WHERE t.forumid = f.forumid
ORDER BY t.lastpost DESC
LIMIT 30"
);
while (
$bits mysql_fetch_array($result))
{
    
print_r($bits);

Reply With Quote
  #4  
Old 03-21-2003, 05:24 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do i add it so it shows it in this template which is for the index.php (http://www.myfootballforum.com)

Code:
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

{htmldoctype}
<html>
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<!-- end no cache headers -->
<META NAME="title" CONTENT="My Football Forum - World Wide Football Forums">
<META NAME="keywords" CONTENT="football forum soccer discussion board message">
<META NAME="description" CONTENT="Over 60 forums to talk about football with people from all over the world">

<TITLE>My Football Forum - World Wide Football Forums</TITLE>
$headinclude
</head>
<body>
$index_header
</body></html>
<div align="center">
  <center>
<table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="740" id="AutoNumber1">
  <tr>
    <td width="200" valign="top">$welcometext $currentpoll

$buddylist

$loggedinusers $search $custom1

$custom2 $stats $calendar</td>
    <td valign="top"> <table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="100%"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" width="100%" style="border-collapse: collapse" bordercolor="#111111">
<tr id="cat"><td bgcolor="#3D7CB6" valign="top" width="100%">
  <p align="center"><b><font color="#FFFFFF" size="5" face="Arial">Welcome To My 
  Football Forum</font></b></td>
  </tr>
<tr id="cat"><td bgcolor="#D5E2F0" valign="top" width="100%">
  <p align="justify"><font size="2" face="Arial">We have been on the internet 
  since <b>17th March 2002</b>. We started as <b>footballboard.net</b> and we 
  then merged with <b>football-forum.com</b> and became <b>myfootballforum.com</b>. 
  Ever since the merger we have become one of the better forums on the internet. 
  We are not the biggest, we don't have the most members, but what we do have is 
  quality members who keep the discussion alive.</font></p>
  <p><font size="2" face="Arial"><b>You have to register to post </b>and reply 
  but if you just want a peek, then click the link below.</font></p>
  <p align="center"><font size="5" face="Arial">
  <a href="http://www.myfootballforum.com/discussion/forums.php">PEEK</a> -
  <a href="http://www.myfootballforum.com/discussion/register.php?s=&action=signup">
  REGISTER</a></font></td>
  </tr>
<tr id="cat"><td bgcolor="{tableheadbgcolor}" valign="top" width="100%">
  Current LIVE discussion on myfootballforum.com<br>
  $threadbits</td>
  </tr>
</table> </td></tr></table>


    </td>
  </tr>
</table>

  </center>
</div>

<p>
<html>
<body>
</body></html></p>
<p>$index_footer<html><body></p>
</body></html></body>

</html>
I am a beginner so i need step by step instructions just untill i get better.
Reply With Quote
  #5  
Old 03-21-2003, 06:35 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will someone be able to help me out (give me instructions) as i want this on my forum a.s.a.p.

Thanks
Reply With Quote
  #6  
Old 03-21-2003, 07:21 PM
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Location: Glasgow
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok create a new .php file and call it stats.php (use the code posted by filburt) then add this line.

Code:
<div align="center">
      <center>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
        <tr>
          <td width="100%"><?php include("http://www.whatever.com/forum/stats.php"); ?></td>
        </tr>
      </table>
      </center>
    </div>
    </td>
add that in after

Code:
$buddylist

$loggedinusers $search $custom1

$custom2 $stats $calendar<br>
Reply With Quote
  #7  
Old 03-21-2003, 09:05 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That stats.php does not work. I get this error:


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/myfootba/public_html/discussion/stats.php on line 19

try it yourself: http://www.myfootballforum.com/discussion/stats.php



BELOW IS THE CODE INSDE stats.php:

==========================




<?php

echo "<pre>";
$result = mysql_query("SELECT t.threadid,
t.title,
t.lastposter,
t.replycount,
t.views,
t.forumid,
f.title,
t.lastpost

FROM thread AS t,
forum AS f

WHERE t.forumid = f.forumid
ORDER BY t.lastpost DESC
LIMIT 30");
while ($bits = mysql_fetch_array($result))
{
print_r($bits);
}

?>










===============================
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 09:57 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.04192 seconds
  • Memory Usage 2,224KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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