Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[HTL] Addon: Auto-populate NavBar popup menu [for Erwin's Flash Player] Details »»
[HTL] Addon: Auto-populate NavBar popup menu [for Erwin's Flash Player]
Version: 1.00, by Natch Natch is offline
Developer Last Online: Apr 2022 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 01-22-2004 Last Update: 01-27-2004 Installs: 4
 
No support by the author.

Addon: Auto-populate NavBar popup menu [for Erwin's Flash Player]
Version: 1.2
vB-version: 3.0.0 Release Candidate 3
Developer: Natch
Install difficulty: Easy-as
File edits: 2
Template edits: 2

Description of the Hack:
This takes all your Flash Games you have uploaded into the /forums/games/ folder, and parses them into an array, then creates a vB3 (so cool) drop-down menu, and populates that menu with nicely-labelled links to every one of your games (provided they have the extension .swf.


HACK INSTALLATION DETAILS:
Files modified for this Hack:
global.php
includes/functions.php

Templates modified for this Hack:
navbar


NOTE: In attachment are both HTL and text instructions.

Pop the HTL file and the XML file into your htlfiles folder (remember to ensure the htl file is uploaded as BINARY) and run it thru the HTL, or read the text file and DIY

Enjoy! and props to Erwin for his great work ...


UPDATE: 1.2 Upgraded to HTL format.

UPDATE: 1.1 Added a script to format visible link names more neatly.

RELEASE: 1.0 Initial vB.org release.

Show Your Support

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

Comments
  #12  
Old 01-27-2004, 07:50 PM
CdaKnight CdaKnight is offline
 
Join Date: Jan 2002
Location: Houston
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I tried to load in the HTL version, I got a database error...

I went to "Install Hack" via the HTL, and chose the "Auto-Populate Navbar popup menu [for Erwin's Flash Player]" from the list. Then I hit the confirm button, and it wasn't happy. Any ideas?

Code:
Database error in vBulletin 3.0.0 Release Candidate 3:

Invalid SQL: INSERT INTO hacklog (hacklogid, hackid, modname, modtype, linenumber, changetype, userid, oldcode, newcode, dateline, lastmodified, notes) VALUES ('', 1, 'navbar', 1, 0, 1, 283, '<!-- / NAVBAR POPUP MENUS -->
', '	<if condition=\"$show[\'member\']\"> // remove this line and the endif if you wish all users and  guests to view the menu
		<!-- flash player auto-menu -->
		<div class=\"vbmenu_popup\" id=\"flashplayer_menu\" style=\"display:none\">
			<table cellpadding=\"4\" cellspacing=\"1\" border=\"0\">

			<tr><td class=\"thead\">$vbphrase[flashplayer_title]</td></tr>
$nav_flash
			</table>
		</div>
		<!-- / flash player auto-menu -->
	</if>
', 1075184306, 1075203260, ''), ('', 1, 'navbar', 1, 0, 1, 283, '			<if condition=\"$show[\'searchbuttons\']\">
				<td class=\"vbmenu_control\"><a href=\"$vboptions[bburl]/search.php?$session[sessionurl]do=getnew\">$vbphrase[new_posts]</a></td>
				<td id=\"navbar_search\" class=\"vbmenu_control\"><a href=\"$vboptions[bburl]/search.php?$session[sessionurl]\">$vbphrase[search]</a> <script type=\"text/javascript\"> vbmenu_register(\"navbar_search\"); </script></td>
			</if>
', '			<if condition=\"$show[\'member\']\">
				<td id=\"flashplayer\" class=\"vbmenu_control\"><a href=\"#flashplayer\">$vbphrase[flashplayer_title]</a> <script type=\"text/javascript\"> vbmenu_register(\"flashplayer\"); </script></td>
			</if>
', 1075184306, 1075203260, ''), ('', 1, 'includes/functions.php', 0, 0, 1, 283, '/*======================================================================*\\
|| ####################################################################
|| # Downloaded: 20:02, Wed Jan 21st 2004
|| # CVS: $RCSfile: functions.php,v $ - $Revision: 1.934 $
|| ####################################################################
\\*======================================================================*/
?>
', 'function genFlashMenu($flashdir) {
	global $vboptions;
	$swfarray = getInstalledGames($flashdir);
	foreach ($swfarray as $filename) {
			$playvar = substr($filename, 0, strpos($filename,\".\"));
			$displayname = properCase($playvar);
			$flashmenu.= \"\\t\\t<tr><td class=\\\"vbmenu_option\\\"><a href=\\\"$vboptions[bburl]/flash.php?play=\".$playvar.\"\\\">$displayname</a></td></tr>\\n\";
	}
	return $flashmenu;
}
function getInstalledGames($flashdir) {
	$dh = opendir( $flashdir );
		while( false !== ($file = readdir( $dh ))) {
		// look for these file types....
			if (eregi(\"(swf)$\",$file)) {
				$swfs[] = $file;
			}
		}
	return $swfs;
}
function properCase($text) {
	$firstLetter = substr($text,0,1);
	$rest = substr($text,1,strlen($text));
	$spitout = strtoupper($firstLetter).$rest;
	return $spitout;
}
', 1075184209, 1075203260, ''), ('', 1, 'global.php', 0, 0, 1, 283, '/*======================================================================*\\
|| ####################################################################
|| # Downloaded: 20:02, Wed Jan 21st 2004
|| # CVS: $RCSfile: global.php,v $ - $Revision: 1.240 $
|| ####################################################################
\\*======================================================================*/
?>
', '	$flashdir = \'/full path to your/forums/games/\'; // alter this variable to match your forum setup
	$nav_flash = genFlashMenu($flashdir);
', 1075184209, 1075203260, '<span style=\'font-size:larger\'><b>NOTE</b>: you MUST alter the path variable <b>$flashdir</b> here to match your forum setup.</span>')
mysql error: Unknown column 'changetype' in 'field list'

mysql error number: 1054

Date: Tuesday 27th of January 2004 01:37:35 PM
Script: http://*/hackadmin.php
Referer: http://*/hackadmin.php
Username: Atwookie
IP Address: *.*.*.*
Reply With Quote
  #13  
Old 01-27-2004, 08:37 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well the error is referring to the hacklog table, saying
Code:
mysql error: Unknown column 'changetype' in 'field list'

mysql error number: 1054
so I'll take this up to KuraFire ...

Q: had you removed all alterations from your manual install ?

[and can you edit your post to use {php} or {code} tags - that would make sure this entry full of hack-modifications is displayed properly ...]
Reply With Quote
  #14  
Old 01-27-2004, 08:45 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE=CdaKnight]When I tried to load in the HTL version, I got a database error...

I went to "Install Hack" via the HTL, and chose the "Auto-Populate Navbar popup menu [for Erwin's Flash Player]" from the list. Then I hit the confirm button, and it wasn't happy. Any ideas?

Quote:
Database error in vBulletin 3.0.0 Release Candidate 3:

Invalid SQL: INSERT INTO hacklog (hacklogid, hackid, modname, modtype, linenumber, changetype, userid, oldcode, newcode, dateline, lastmodified, notes) VALUES
[ .... ]
mysql error: Unknown column 'changetype' in 'field list'

mysql error number: 1054
Very strange... does your table `hacklog` on your database have the column 'changetype' ??
Reply With Quote
  #15  
Old 01-27-2004, 08:47 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KuraFire
Very strange... does your table `hacklog` on your database have the column 'changetype' ??
Actually, now that I look at it I'm somewhat concerned...

the query says to insert these file/template modifications to hackid=1, but that one is reserved for the HTL itself...


*so confused*

*so scared that he had a major f*ckup in his script* :'(((
Reply With Quote
  #16  
Old 01-27-2004, 09:06 PM
CdaKnight CdaKnight is offline
 
Join Date: Jan 2002
Location: Houston
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have that column, although now I'm guessing I should... I used the installer... Is it possible to just drop 'hack' and 'hacklog' and run the installer to add them again (I'm assuming I wouldn't need the phrases, etc. again [including the file changes])

Kura, if you'd like to access my admincp, or need a copy of the files, please let me know what you need and I'll PM it to you.

And I could have sworn I installed the upgrade... and I'll check again and make sure I did it correctly. I'm normally not this incompetent with this stuff...

Oh, and PS: I never had a manual install. I chose to wait due to time constraints, and was very happy when you release the HTL version, saving me time.
Reply With Quote
  #17  
Old 01-27-2004, 09:27 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KuraFire
Actually, now that I look at it I'm somewhat concerned...

the query says to insert these file/template modifications to hackid=1, but that one is reserved for the HTL itself...


*so confused*

*so scared that he had a major f*ckup in his script* :'(((
It would only insert to hackid 1 if the HTL wasn't properly installed isn't that rite Kura ?
Reply With Quote
  #18  
Old 01-27-2004, 10:16 PM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CdaKnight
I don't have that column, although now I'm guessing I should... I used the installer... Is it possible to just drop 'hack' and 'hacklog' and run the installer to add them again (I'm assuming I wouldn't need the phrases, etc. again [including the file changes])
What you can do to solve this is this:

1) make sure you have the Hack_Tracking_Log.htl file in your htlfiles/ directory;
2) go to Manage Hacks -> Edit Hack Details for the Hack Tracking Log entry;
3) disable all steps for the Install Routine except Run Queries;
4) Save. Now go to Run Install Sequence (it's in the drop-down Controls menu) for the Hack Tracking Log;
5) Choose to run a Real Install, and click Proceed (or Continue?). You will now only encounter the Run Queries step. It will perform that step, which will clear out your hack and hacklog tables entirely!.
6) You will now have an empty HTL installation, which is baaaaad. So, we fix! Go to install hack, and choose the Hack Tracking Log that is listed there. Choose Import to Db only ! Hit proceed.
7) The HTL will now be imported to your system, but it will not appear as properly installed, but as Imported-only. To fix that, run this query on your database (manually):

UPDATE hack SET atstep=-1 WHERE hackid=1;

add a table prefix in front of "hack" if you have one.

Then your HTL installation should be fully operational again, and have the column changetype.
If not, your .htl file is corrupted somehow, outdated-beyond-all-outdatedness.


Natch: pretty much, yeah...
Reply With Quote
  #19  
Old 01-28-2004, 02:15 AM
CdaKnight CdaKnight is offline
 
Join Date: Jan 2002
Location: Houston
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I've done something horribly wrong. So I just dropped the hack log tables, redownloaded everything, and reinstalled. Works like a bute.

However, I have two problems with this actual hack now. :\

1) The phrase you specify in your instructions is different that the one inserted into the phrase database.
2) The Javascript menu isn't coming up. I get the little arrow, however the title "Flash", and the titles of all the games come on top of my welcome DIV.
Reply With Quote
  #20  
Old 01-28-2004, 02:41 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CdaKnight
I think I've done something horribly wrong. So I just dropped the hack log tables, redownloaded everything, and reinstalled. Works like a bute.

However, I have two problems with this actual hack now. :\

1) The phrase you specify in your instructions is different that the one inserted into the phrase database.
2) The Javascript menu isn't coming up. I get the little arrow, however the title "Flash", and the titles of all the games come on top of my welcome DIV.
The phrases don't match up ?

If this is the case, then that would explain why your menu title ain't workin'

What is the phrase title that is being inserted ?
Reply With Quote
  #21  
Old 01-28-2004, 02:45 AM
CdaKnight CdaKnight is offline
 
Join Date: Jan 2002
Location: Houston
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It was just "flash_title" instead of "flash_addon_title". I was simply alerting you so that it can be remedied. I changed the phrase to match the one inserted by the install in the template, however the menu itself is not being created via the javascript.

Lemme post a screen of what's happening.
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 12:58 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.06030 seconds
  • Memory Usage 2,334KB
  • Queries Executed 27 (?)
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
  • (2)bbcode_code
  • (5)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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