![]() |
Compose External Javascript
vB Compose External v. 1.0.3 (Updated)
This hack provides an easy way to generate JS-Code for the Javascript syndication system on vB 3. It has been tested with VB 3.0.0 RC 1 and higher. Features:
Insert the phrases using the XML-files. There are phrases for some languages. You can of course translate them to other languages using the phrase-system. If you do so, please send me the XML-files for these translations. I will add them to this ZIP. Right now there are:
Step 2: Upload the file composeexternal.php in the root of your forum. Upload the files in the folder /images/composeexternal/ on the server. Step 3: Add a new template with the name "composeexternal" and add the content of composeexternal_template.txt (in this zip) to it. Step 4: Search for the following code on template forumdisplay: Code:
Code:
Search for: Code:
Code:
Step 5: Search for the following code on template navbar: Code:
<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php?$session[sessionurl]">$vbphrase[whos_online]</a></td></tr></if> Add below: Code:
<tr><td class="vbmenu_option"><a href="composeexternal.php?$session[sessionurl]">$vbphrase[composeexternal_categorystrip]</a></td></tr> Credits go to Ypsfanpage.de - a user of our forum. He coded the initial php-file. I ported it to the VB-system and created the php-file and the template. See the screen-shots below, how it works, or visit our testsite. Version-History v. 1.0.0 - Initial release v. 1.0.1 - Added character-limitation v. 1.0.2 - Got rid of a small bug, occuring in MSIE, happened when there where too less threads, genereal optimization of the code v. 1.0.3 - Added three pre-made templates v. 1.0.4 - Added support for forumdisplay-template and navbar-template Please click on install, when you choose to use this hack :) |
This is a great idea, might use it on my site when I get to vB3.
|
Very nice.. Do you think you can add some type of option to limit the amount of characters to show.. something like:
<script type="text/javascript"src="http://www.cogumelosmagicos.org/forum/external.php?forumids=30,31,32,38,40&type=js"> </script> <script type="text/javascript"> <!-- for (i = 0; i < 1; i++) var titleAsString = new String(threads[i].title); if (titleAsString.length > 27) { var newTitle = titleAsString.substring(0,27); document.write("Tópico: <a href=\"http://www.cogumelosmagicos.org/forum/showthread.php?threadid="+threads[i].threadid+"\">"+newTitle + "..."+"</a><br />Autor: <a href=\"http://www.cogumelosmagicos.org/forum/member.php?u="+threads[i].poster+"\">"+threads[i].poster+"</a> - "+threads[i].threadtime+"<br />"); } else { document.write("Tópico: <a href=\"http://www.cogumelosmagicos.org/forum/showthread.php?threadid="+threads[i].threadid+"\">"+titleAsString+"</a><br />Autor: <a href=\"http://www.cogumelosmagicos.org/forum/member.php?u="+threads[i].poster+"\">"+threads[i].poster+"</a> - "+threads[i].threadtime+"<br />"); } //--> </script> Thank You |
I am incorparating that at this moment, will soon post the new file :) Plus, I already have some new ideas. Will post them also soon :)
|
Ok, here we go, just updated the file. The old version - if someone doesn't need the character-limitation - is still available for download.
Two more phrases have been updated with the new release: - composeexternal_charlimit - composeexternal_charlimitdescription |
Got it.. It works fine.. Thanks a lot.. I hope you'll add more feature to it on future releases... features such as pulling polls, etc..
Also a link to the poster would be nice.. [high]* gldtn clicks install :)[/high] |
Quote:
And if by then it is foreseeable, that Jelsoft is not going to extend the external.php, we will look into that. I would love to see some more things to appear there too. Polls, postings, poster. They are all not covered right now. |
Awesome, I'm looking forward to this, If my scripting knowledge was any good I would've be willing to help you guys out.
Thanks once again for this great hack :D |
nice script you got there :)
seems what ever is generated when used on a web site generates a javascript error in IE 6.0.2800.1106 Code:
Error: 'threads[...].title' null or not an object |
okay so that error is due to having less than 15 threads in the forum being called :o
i got it working with this code thanks to your generator saved the below code in a file named last15.php Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> where fid is the forumid i want to call |
very nice :)
|
Quote:
BUT: This would not help, if after the creation of the JS-code, there would be less threads (through deletion) than priorly confirmed in the forum. So... we need to find a way to eliminate the JS-error, rather than making a workaround in the PHP-file. I might have an idea, but will look into it tomorrow err - today, as it is already 01:46 a.m. here in Germany ;) Interesting: Mozilla doesn't have problems with the Javascript. Oh well... MSIE ... Nah, I don't say more :D |
Had no javascript errors here with Monzilla and neither with I.E. There is only one thing bugging me.. the delay to update the threads.. I get new threads in the forum but sometimes it don't even updates it for some reason.
|
This might be because ot the JS being cached. Adding the following code to your Header might help:
Code:
<meta NAME="revisit-after" CONTENT="0 days"> |
+K for you, too bad Karma is not turned on in this forum :/. Its working flawless now, thanks to you..
Oh.. one more question, not sure if this is possible due to the limitation on the external.php, but is there a way to get the topics to update when there is a new reply to it.. rather than only when a new topic is posted? |
At this moment this is not possible and would require hacking the external.php - but comes time, comes solution :D
|
Here we go: On our new developing system, my co-coder Ypsfanpage.de optimized the code, redrucing some clutter and got rid of the bug in the JS on MSIE. So here we go with version 1.0.2 :)
Work is in progress for the following features (which will then be version 1.0.3): - Having some predefined styles at hand - for the ones who have problems coding ;) |
Now, version 1.0.3 is online. We added three pre-defined styles - which you can change on composeexternal.php if you wish. The download is now bigger and containing previews of the pre-defined styles.
Work is in progress for the following feature (which will be in version 1.0.4): - Adding the possibility to generate the code for a specific forum changing forumdisplay-template and adding a new point to the forum-tools popup-menu. |
Latest installment: version 1.0.4, which offers direct support of forumdisplay and navbar-templates, giving you instructions how to integrate it in these templates. We had to change our template and the php-file a bit, so please redownload the package.
The next release will be a while away, as we are now working on the conversion of our big production-board. But the support of course continues and should there be any bugs, we will eliminate them of course :) |
for some reason i keep getting 'threads.. is undefinied' on first load of page but if i hit ctrl+F1 it loads the threads on external page ? i.e. at http://animeboards.com/showthread.php?t=55535 the 3 example sites i used all don't show threads on first load only on refresh
|
Quote:
also would it be possible to make composexternal.php an admin only viewing page/function |
Quote:
HTML Code:
<script type="text/javascript" src="http://animeboards.com/external.php?forumids=3&type=js"> |
Quote:
If you would like to use it on your own, without adding it to the templates, then add a bookmark or favorite to your browser ;) You don't have to add a link to composeexternal.php to your site. :D |
Quote:
i found via website code validator some of the close tags in the javascript aren't escaped... but fixing that doesn't solve my problem - it seems to be just me as others can see it |
Have you tried to put the code into the body-tag, as I said?
|
Quote:
|
This is a very cool hack. :) Well done!
|
Quote:
|
Quote:
|
Quote:
So I looked into the code and found the first big problem: The code is never the same. It seems, that you have used different versions of the script. Can you please do the following: - Use the latest version of the script on all three sites. - And add all code produced by the script only to the body. When you have done so, please tell it to me, and I will test all three of them again. And if the error still occurs - it doesn't do it on our testsite with the latest script - then I will try to find the error. :) |
Quote:
|
Quote:
Code:
<?php |
one thing though when i uploaded your stock composer on my site the generated code made external.php's link as
www.animeboards.net/external.php since animeboards.com is a domain alias for animeboards.net |
Hi Bernd,
great hack. I have installed this on my testboard and when i generate the code for one specific forum, the preview alawys shows me the latest 5 threads from the whole forum. The generated external.php link is ok (external.php?forumids=44&type=js) i think. Is there a way to solve this? |
Quote:
PHP Code:
PHP Code:
PHP Code:
|
Quote:
|
Quote:
Code:
<script type="text/javascript" src=http://animeboards.com/external.php?forumids=<?php echo $fid; ?>&type=js></script> |
Quote:
Let's hope they'll fix this bug in RC3/Gold version. |
Hey Bernd,
i finally got it working after i upgraded my live board, but after the code insert, the XHTML compatibility was broken. Is the code XHTML-valid? |
Hm for xhtml-compatibility the code has to be with low-characters. A far as I can see, everything is in that way, but I will take look asap. :)
|
All times are GMT. The time now is 03:18 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|