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
Compose External Javascript Details »»
Compose External Javascript
Version: 1.00, by Bernd Glasstett Bernd Glasstett is offline
Developer Last Online: Feb 2023 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-05-2004 Last Update: Never Installs: 18
 
No support by the author.

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:

  • Complete control of the HTML-code before, after and in between the links to the threads
  • Possibility to enter a maximum-value for the count of threads to be displayed by the administrator
  • Users can choose more than one forum to be displayed
  • Users can choose how many threads to be displayed
  • Users can choose how many characters in the thread title should appear (new in version 1.0.1)
  • Users can choose from three pre-made styles (new in version 1.0.3)
  • Integration into forumdisplay and navbar-templates (new in version 1.0.4)
  • Complete integration in the look and feel of vB 3
  • Phrase-compatibility
Plans for future versions:
  • Option to choose the forums from a pulldown-men?
  • Option to add it to the forum-tools (in order to be able to have the JS-Script created for this specific forum)
  • Options for creating the URLs for XML- and RSS-feeds
  • Adding new features when external.php will be updated with new features
These are the instructions how to install it:
  • New templates: 1
  • Templates to be changed: 2
  • PHP-files to be added: 1
  • Phrases to be added: 23
Step 1:
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:
  • German
  • English
Please be sure to save the language in the phrase system BEFORE you do so!

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:
 
 	    	<div><img class="inlineimg" src="$stylevar[imgdir_button]/subscribe.gif" alt="$vbphrase[view_parent_forum]" vspace="1" /> <a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[parentid]">$vbphrase[view_parent_forum]</a></div>
 		</div>
 	</td>
 	<!-- / forum tools -->
Replace with the following code:
Code:
 
 	    	<div><img class="inlineimg" src="$stylevar[imgdir_button]/subscribe.gif" alt="$vbphrase[view_parent_forum]" vspace="1" /> <a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[parentid]">$vbphrase[view_parent_forum]</a></div>
 		</div>
 		    <div><img class="inlineimg" src="$stylevar[imgdir_button]/subscribe.gif" alt="$vbphrase[composeexternal_categorystrip]" vspace="1" /> <a href="composeexternal.php?$session[sessionurl]do=composecode&amp;f=$foruminfo[forumid]">$vbphrase[composeexternal_categorystrip]</a></div>
 
 	</td>
 	<!-- / forum tools -->


Search for:
Code:
 
 	<if condition="$show['adminoptions']">
Add above:
Code:
 
 	<tr><td class="vbmenu_option"><a href="composeexternal.php?$session[sessionurl]do=composecode&amp;f=$foruminfo[forumid]">$vbphrase[composeexternal_categorystrip]</a></td></tr>


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

Show Your Support

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

Comments
  #32  
Old 01-12-2004, 04:03 PM
wacnstac wacnstac is offline
 
Join Date: Nov 2001
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
What do you need to be explained? The insertion, the translation of the phrases, or how to export them? Or all of them Just want to be sure to explain the right thing
The whole process in general on how to add phrases. I only see a menu option to upload/download a whole language in the control panel.
Reply With Quote
  #33  
Old 01-13-2004, 12:36 AM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bernd Glasstett
Strange thing. I tried alle examples again. This time the first two are working fine, the third produces the error. Then I tried again. This time the second one came up with the error.

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.
done but really anime_news.php is the only one i care about right now i have the following in that file

Code:
<?php
if ( is_numeric($fid) ) {
$fid = $fid;
} else {
$fid = 224;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta NAME="revisit-after" CONTENT="0 days">
<meta http-equiv="expires" content="0">
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>Anime News - Animeboards.com</TITLE>
</HEAD>
<BODY>
<p>
This is a example of some javascript code you can add to your own anime web site to display anime news reported by Animeboards.com. Display, font, color etc are all customisable to fit into your web site's design and color scheme.
</p>
<script type="text/javascript" src="http://animeboards.com/external.php?type=js&amp;forumids=<?php echo($fid); ?>"></script>
<b>Last 15 Threads :</b><br><table width="60%">
<script type="text/javascript">
<!--
 var max = 15;
 if(threads.length < max) 
 max = threads.length;
 for(i = 0; i < max; i++)
  { 
   if (threads[i].title.length > 50)
    { threads[i].title = threads[i].title.substring(0, 50) + '...'; }
   document.writeln("<tr><td><a href=\"http://animeboards.com/showthread.php?t=" + threads[i].threadid + "\">" + threads[i].title + "<\/a>  <\/td><td><small> : (by " + threads[i].poster + ")<\/small><\/td><td> : <small>" + threads[i].threaddate + "<\/small><\/td><\/tr>");
  }
//-->
</script>
</table>


</BODY>
</HTML>
Reply With Quote
  #34  
Old 01-13-2004, 12:39 AM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #35  
Old 01-13-2004, 07:45 AM
daFish's Avatar
daFish daFish is offline
 
Join Date: Nov 2002
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #36  
Old 01-13-2004, 07:58 AM
Bernd Glasstett's Avatar
Bernd Glasstett Bernd Glasstett is offline
 
Join Date: Sep 2002
Location: Waldshut-Tiengen Germany
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by eva2000
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
That is something, which we cannot resolve generally. We use the following code to generate the address:

PHP Code:
 $server2_url $_SERVER['REQUEST_URI'];
 
$folder_url str_replace("/composeexternal.php?do=composecode"""$server2_url);
 
$server_url "[url="http://&quot;.$_SERVER"]http://".$_SERVER[/url]['SERVER_NAME'];
 
$forum_url $server_url $folder_url
It takes the request_uri, which is the whole URL, including the /composeexternal-Part and without the http://www-Part. Than it takes the http://-Part and combines the two. What you can do is, search in our script for:

PHP Code:
 $server_url "[url="http://&quot;.$_server['server_name'/"]http://".$_SERVER['SERVER_NAME'[/url]]; 
and replace it with:

PHP Code:
 $server_url "[url="http://&quot;.$_server['server_name'/"]http://animeboards.com[/url]"; 
We wanted it to program as universal as possible, but domain-aliases are almost impossible to get dynamically. The variable above always gets the main domain.
Reply With Quote
  #37  
Old 01-13-2004, 08:00 AM
Bernd Glasstett's Avatar
Bernd Glasstett Bernd Glasstett is offline
 
Join Date: Sep 2002
Location: Waldshut-Tiengen Germany
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by daFish
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?
Hacking the external.php that would be. We noticed the bug. It is located in the external.php. The strange thing is: it doesn't appear always. As it also bugs us a little, we are currently looking for a solution - always thinking about: What if Jelsoft gets rid of the bug in a future version?
Reply With Quote
  #38  
Old 01-13-2004, 08:12 AM
Bernd Glasstett's Avatar
Bernd Glasstett Bernd Glasstett is offline
 
Join Date: Sep 2002
Location: Waldshut-Tiengen Germany
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by eva2000
done but really anime_news.php is the only one i care about right now i have the following in that file
Code:
<script type="text/javascript" src="http://animeboards.com/external.php?type=js&amp;forumids=<?php echo($fid); ?>"></script>
ok, first things first: Please use

Code:
 <script type="text/javascript" src=http://animeboards.com/external.php?forumids=<?php echo $fid; ?>&type=js></script>
Instead of the above code. So that it uses the same code, as we are currently using on our development-board We noticed that while &amp; should work out it sometimes doesn't. That's why we use & again. Let's see if the problem is solved with this
Reply With Quote
  #39  
Old 01-13-2004, 08:13 AM
daFish's Avatar
daFish daFish is offline
 
Join Date: Nov 2002
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bernd Glasstett
Hacking the external.php that would be. We noticed the bug. It is located in the external.php. The strange thing is: it doesn't appear always. As it also bugs us a little, we are currently looking for a solution - always thinking about: What if Jelsoft gets rid of the bug in a future version?
Thanks for clearing this up.
Let's hope they'll fix this bug in RC3/Gold version.
Reply With Quote
  #40  
Old 01-24-2004, 11:47 AM
daFish's Avatar
daFish daFish is offline
 
Join Date: Nov 2002
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #41  
Old 02-05-2004, 02:46 PM
Bernd Glasstett's Avatar
Bernd Glasstett Bernd Glasstett is offline
 
Join Date: Sep 2002
Location: Waldshut-Tiengen Germany
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
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 06:32 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.07213 seconds
  • Memory Usage 2,341KB
  • Queries Executed 25 (?)
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
  • (9)bbcode_code
  • (3)bbcode_php
  • (6)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
  • (4)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_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