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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2008, 06:45 PM
nanaimobar nanaimobar is offline
 
Join Date: Nov 2005
Location: Canada
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Any way to display or print list of forum id's

Is there any simple way to display or print list of forum id's? The reason I ask is that some mods require forum id's or other pertinent data which would be easy to input if one had a printout or a text file for reference.

Maybe I'm dumber than a store-full of Stanley hammers but the only way I can get forum id's from within the Admincp is to manually open each forum or sub-forum.

Any suggestions greatly appreciated.
Reply With Quote
  #2  
Old 11-08-2008, 07:41 PM
mikewastaken mikewastaken is offline
 
Join Date: Nov 2008
Location: Canada
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On your forumhome, if you hover over one of the link's, it should say something like this :

http://www.yoursite.com/forumdisplay.php?f=9

9 is the id

That's the quick way of being able to see your categories ID
Reply With Quote
  #3  
Old 11-08-2008, 07:56 PM
nanaimobar nanaimobar is offline
 
Join Date: Nov 2005
Location: Canada
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mikewastaken View Post
On your forumhome, if you hover over one of the link's, it should say something like this :

http://www.yoursite.com/forumdisplay.php?f=9

9 is the id

That's the quick way of being able to see your categories ID

It's not that I can't see them or can't find them easily enough by clicking through the AdminCP Forum Manager, but rather that I would like a way to print out a list of forum and sub-forum id's.

Some sites may have a large number of forums and sub-forums and having a way to print-out a list of id's would perhaps make life a little easier for them.
Reply With Quote
  #4  
Old 11-08-2008, 08:22 PM
mikewastaken mikewastaken is offline
 
Join Date: Nov 2008
Location: Canada
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could make a mysql query something like :

$result = mysql_query("SELECT forumid, title FROM forums order by forumid desc");

while($row = mysql_fetch_array($result))
{
echo "ForumID=".$row['forumid'] . " " . $row['title'];
echo "<br />";
};

It would come up like

ForumID=1 My First Forum
ForumID=2 My Second Forum
ForumID=3 My Third Forum

This way also, your mods could load the page up and see it themselves, and if anything changes, the script changes obviously.
Reply With Quote
  #5  
Old 11-08-2008, 08:34 PM
nanaimobar nanaimobar is offline
 
Join Date: Nov 2005
Location: Canada
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mikewastaken View Post
You could make a mysql query something like :

$result = mysql_query("SELECT forumid, title FROM forums order by forumid desc");


while($row = mysql_fetch_array($result))
{
echo "ForumID=".$row['forumid'] . " " . $row['title'];
echo "<br />";
};


It would come up like

ForumID=1 My First Forum
ForumID=2 My Second Forum
ForumID=3 My Third Forum



This way also, your mods could load the page up and see it themselves, and if anything changes, the script changes obviously.
Mikewastaken, when I click on the Execute SQL Query link in the AdminCP I get a message indicating "You are not authorized to execute SQL queries".
Reply With Quote
  #6  
Old 11-08-2008, 08:53 PM
mikewastaken mikewastaken is offline
 
Join Date: Nov 2008
Location: Canada
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in your include/config.php file, find the following


Code:
	//	****** USERS WITH QUERY RUNNING PERMISSIONS ******
	//	The users specified here will be allowed to run queries from the control panel.
	//	See the above entries for more information on the format.
	//	Please note that the ability to run queries is quite powerful. You may wish
	//	to remove all user IDs from this list for security reasons.
$config['SpecialUsers']['canrunqueries'] = '';
Usually the first person is admin, which is you. So put in '1'.
Reply With Quote
  #7  
Old 11-08-2008, 09:09 PM
nanaimobar nanaimobar is offline
 
Join Date: Nov 2005
Location: Canada
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mikewastaken View Post
in your include/config.php file, find the following


Code:
	//	****** USERS WITH QUERY RUNNING PERMISSIONS ******
	//	The users specified here will be allowed to run queries from the control panel.
	//	See the above entries for more information on the format.
	//	Please note that the ability to run queries is quite powerful. You may wish
	//	to remove all user IDs from this list for security reasons.
$config['SpecialUsers']['canrunqueries'] = '';
Usually the first person is admin, which is you. So put in '1'.
Hi mikewastaken,

Changed config - which worked like a charm - but when I ran query I got this error:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: 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 '$result = mysql_query("SELECT forumid, title FROM forums order by forumid desc")' at line 1

The mysql version running the site is 4.1.22
and core tables haven't been changed. Site is running vbulletin 3.7.4.
Reply With Quote
  #8  
Old 11-08-2008, 09:45 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

because that code isnt an sql query... i believe its a php script that needs to be run from vbulletin?!?!

you would need to add some includes i think, like global.php but im not sure about this, so i'll wait until someone who knows steps in
Reply With Quote
  #9  
Old 11-08-2008, 10:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just open a text editor, and put in (small change in query from above since the name of the table is 'forum', not 'forums'):
Code:
<?php

require_once('./global.php');

$result = mysql_query("SELECT forumid, title FROM forum order by forumid desc");


while ($row = mysql_fetch_array($result))
{
echo "ForumID=".$row['forumid'] . " " . $row['title'];
echo "<br />";
};

?>
Save as whatever.php, upload via ftp, and point your browser to it and it will spit it all out. Change 'desc' to 'asc' if you wish it to be in ascending order instead.
Reply With Quote
  #10  
Old 11-08-2008, 10:36 PM
nanaimobar nanaimobar is offline
 
Join Date: Nov 2005
Location: Canada
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BigJohnny View Post
because that code isnt an sql query... i believe its a php script that needs to be run from vbulletin?!?!

you would need to add some includes i think, like global.php but im not sure about this, so i'll wait until someone who knows steps in
The code I should have quoted for the mysql query is:

$result = mysql_query("SELECT forumid, title FROM forums order by forumid desc");


while($row = mysql_fetch_array($result))
{
echo "ForumID=".$row['forumid'] . " " . $row['title'];
echo "<br />";
};

_______
The error reported by vbulletin - in previous post - when running the "Execute SQL Query" from AdminCP is for the first line:
$result = mysql_query("SELECT forumid, title FROM forums order by forumid desc");
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 01:16 PM.


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.05609 seconds
  • Memory Usage 2,259KB
  • Queries Executed 13 (?)
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
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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