vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Questions (https://vborg.vbsupport.ru/showthread.php?t=50575)

mcyates 03-21-2003 02:23 PM

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

mcyates 03-21-2003 04:58 PM

does anyone know?

filburt1 03-21-2003 05:15 PM

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);



mcyates 03-21-2003 05:24 PM

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.

mcyates 03-21-2003 06:35 PM

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

Thanks

colicab-d 03-21-2003 07:21 PM

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>


mcyates 03-21-2003 09:05 PM

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);
}

?>










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


All times are GMT. The time now is 06:23 AM.

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.01141 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete