NewsIndex
v 0.4 beta
Curtiss Grymala
This mod allows you to display various information from the latest posts in one board of your forum on any page of your web site, through the use of SSI, PHP Includes, and javascript includes.
To Use This Mod:
- Install the mod manually or with BoardMod
- Upload all of the files in the "cgi-bin" directory that came with this mod in ASCII mode
- /cgi-bin/yabb2/Admin/NewsIndex_Admin.pl
- /cgi-bin/yabb2/Languages/*.*
- /cgi-bin/yabb2/Sources/NewsIndex.pl
- /cgi-bin/yabb2/Templates/default/newsTemplate.html
The newsTemplate file should be uploaded to the directory that's set as your default template directory. If you have a template directory other than "default" set as your default template, please make sure you upload this file to that directory instead. Also, please keep in mind that this file is completely and totally customizable. See below to find out how to edit your news template
-
Upload all of the modified files in ASCII mode
- /cgi-bin/yabb2/AdminIndex.pl
- /cgi-bin/yabb2/Admin/AdminSubList.pl
- /cgi-bin/yabb2/Admin/ModList.pl
- /cgi-bin/yabb2/Sources/SubList.pl
- Go to your Admin Center, and click on "NewsIndex Settings"
- Set the various options for this mod by going to Admin Center -> NewsIndex Settings
To Display NewsItems On Your Site:
- Open the HTML, PHP, ASP, etc. file that you wish to include your topics in
- Add an include statement to execute the following CGI action: "http://pathtoyourYaBB/YaBB.pl?action=newsindex" (replacing "pathtoyourYaBB" with the actual URL to your YaBB board)
The include statement could look something like
<!--#include virtual="/cgi-bin/YaBB.pl?action=newsindex" -->
<?php virtual('/cgi-bin/YaBB.pl?action=newsindex'); ?>
<script language="javascript" src="/cgi-bin/YaBB.pl?action=newsindex;type=java">
</script>
- If you would like to specify a board other than the one you defined in your Admin settings, you need to add "newsboard=XXXX" to your include statement, where XXXX should be replaced by the actual board ID.
- If you would like to specify a template other than newsTemplate.html, you can add "temp=XXXX" to your include statement, where XXXX should be replaced by the actual name of your HTML template file.
- If you were to define a different board and template, your include statement would look something like:
- Make sure you do some research on using include statements if you haven't used them before.
- Edit the newsTemplate.html file to suit your needs. The following YaBB variables are available for use in the template file:
- - This alternates back and forth between windowbg and windowbg2 classes. This should be placed like: class=""
- - This is the subject of the post. In the Admin Center settings, you can choose whether this should link back to the original topic or not.
- - This is the date and time that the topic was originally created.
- - This is the content of the original topic.
- - This is the Display Name of the person that started the topic. In the Admin Center settings, you can choose to wrap this display name with a link to the user's email address, a link to the user's profile, or no link at all.
- - This will show a number indicating how many replies have been posted in the topic. In the Admin Center settings, you can choose whether this number should link back to the original topic or not.
- - This is linked to $news_txt{'12'} in the language file.
- - This is linked to $news_txt{'13'} in the language file.
- Be sure that all of your style elements are defined somewhere in a style sheet that's linked to the page on your site.
- Be certain that the windowbg and windowbg2 style definitions are included wherever the rest of your style definitions are made.
Changelog:
From 0.3 beta
- Added code boxes in the Admin Center area so that you can copy and paste the include code.
- Fixed javascript support, so that you can definitely use javascript includes now.
- Added a lot of language strings to the language file. You will need to either translate those yourself, or search for new translations in the original BoardMod topic in order to use this mod in languages other than English.
From 0.2 beta:
- Included a new German translation, thanks to JetLi
- Fixed the minor cosmetic issue with the last table row of the Admin settings
- Added the option to choose specific boards and specific templates, in order to allow the user to use this mod for more than one board, and with more than one template.
From 0.1 beta:
- Fixed small bug that made link from topic work incorrectly.
- Added option to link to last post in topic, or first unread post in topic from the comment link.
- Added two new variables to the template, so that all text can be multi-lingual
- Added German translation, thanks to JetLi
- Fixed bug with link to email