The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I saw this on another post (made for v1.1.5)
<?php require("forum/admin/config.php3"); $db=mysql_connect($servername,$dbusername,$dbpassw ord); mysql_select_db($dbname); $query = "SELECT * FROM CATEGORY ORDER BY title ASC"; $resultlatest = mysql_query($query,$db); while ($latest_array = mysql_fetch_array($resultlatest)) { echo "<FONT SIZE=\"1\" FACE=\"Verdana\"> ° <A HREF=\"http://digital-forums.com/forum/index.php3?categoryid=$latest_array[categoryid]\">$latest_array[title]</A></FONT><BR>"; } ?> But I just get this error msg: Warning: Supplied argument is not a valid MySQL result resource in /home/dforums/public_html/list_categories.php3 on line 7 I'm using v2 beta 5 - can someone please get this working for me thanks in advance ! |
#2
|
||||
|
||||
![]()
Here this shows the first two levels of forums...
Code:
<?php require("global.php"); //Forum info $forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder'); while ($forum=$DB_site->fetch_array($forums)) { if ($forum[parentid] == -1) { echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><b><a href=\"http://sitepointforums.com/forumdisplay.php?forumid=".$forum[forumid]."\">".$forum[title]."</a></b></font><br>"); if ($forum[allowposting] == 0) { $parent=$forum[forumid]; $subforums=$DB_site->query("SELECT * FROM forum WHERE displayorder<>0 AND active=1 AND parentid=".$parent." ORDER BY displayorder"); while ($subforum=$DB_site->fetch_array($subforums)) { echo (" <font face=\"Arial, Helvetica, sans-serif\" size=\"-3\"><a href=\"http://sitepointforums.com/forumdisplay.php?forumid=".$subforum[forumid]."\">".$subforum[title]."</a></font><br>"); } } } } $DB_site->free_result($forums); unset($forum); ?> |
#3
|
|||
|
|||
![]()
this is great thanks
couple of things: Only works when calling the script when its in the /forum dir. But gives Fatal error: Failed opening required './admin/config.php3' (include_path='.:/usr/local/lib/php') in /home/dforums/public_html/forum/global.php3 on line 49 when outside the forum dir - is this something to do with the chdir command ? And how to display topics without the sub topics ? Many thanks |
#4
|
|||
|
|||
![]()
ok fixed the first part
![]() chdir("/home/dforums/public_html/forum"); require("global.php3"); now how to list just the topics and not the sub topics - i'll have a go at doing it myself while awaiting help from you guys ![]() |
#5
|
|||
|
|||
![]()
ok i did it - is the code correct or is there anything in there that doesn't need to be there ?
<?php chdir("/home/dforums/public_html/forum"); require("global.php3"); //Forum info $forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder'); while ($forum=$DB_site->fetch_array($forums)) { if ($forum[parentid] == -1) { echo ("<font face=\"Verdana\" size=\"2\"><b><a href=\"http://digital-forums.com/forum/forumdisplay.php3?forumid=".$forum[forumid]."\">".$forum[title]."</a></b></font><br>"); if ($forum[allowposting] == 0) { $parent=$forum[forumid]; } } } $DB_site->free_result($forums); unset($forum); ?> |
#6
|
|||
|
|||
![]()
WITH SUB CATEGORIES
PHP Code:
PHP Code:
|
#7
|
|||
|
|||
![]()
Thats should work. If it doesn't then I dunno
![]() |
#8
|
||||
|
||||
![]()
Great
..but it shows my private forums and categories to normal users!!! |
#9
|
||||
|
||||
![]()
You will have to add a WHERE clause in there to exclude private categories and forums by checking the forums private status.
I have a simple toggle switch in my database called "showactive" if it is true then we show it, if not we don't. The reason for this is we don't want some forums showing up in external scripts even if they are public like General Chit Chat forums and Member only forums. |
#10
|
|||
|
|||
![]()
could you list the code please ?
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|