Page 19 of 44

Posted: Sat Oct 07, 2006 7:16 pm
by MarkDHamill
YAHOOFANCLUB wrote: I want to add RSS button inside each forum with a link to the RSS FEED of that forum. Do you know any MOD like that.


Assuming you are using Smartfeed, I don't know of anyone who has written something like this. There are other newsfeed mods out there, just less sophisticated, so there may be something from searching the Mods database.

In principle it would not be a hard thing to create since most of the public URL is already known, so it would just be a matter of inserting the proper forum ID for the forum parameter.

Posted: Sun Oct 08, 2006 8:30 pm
by EwaldB
It works fine! Thank you!

Posted: Sun Oct 08, 2006 9:23 pm
by MarkDHamill
EwaldB had the same problem as stephen_a. When the template system in phpBB applies smartfeed_url_body.tpl, it generates Javascript like this:

Code: Select all

               if (logged_in)
         {
            url = url + "u={USER_ID}";
            // <!-- BEGIN switch_required_ip_authentication -->
            url = url + "&p={PWD_WITH_IP}";
            // <!-- END switch_required_ip_authentication -->
            // <!-- BEGIN switch_no_required_ip_authentication -->
            if (document.news.ip_auth[0].checked == true)
            {
               url = url + "&p={PWD_WITH_IP}";
            }
            else
            {
               url = url + "&p={PWD}";
            }
            // <!-- END switch_no_required_ip_authentication -->
            if (document.news.remove_yours[0].checked == true)
            {
               url = url + "&removemine=1";
            }
         }
What might work is copying and pasting the text below, replacing smartfeed_url_body.tpl. This is identical to what is in my ZIP file, but I am thinking there is a problem if it is transmitted as BINARY when installed. I am also curious if this happens only to those on MS Windows systems. If so let me know.

Code: Select all

    <script type="text/javascript"> 
    <!-- Hide from older browsers
	function unCheckAllForums () {
		// Unchecks the all forums checkbox
		document.news.all_forums.checked = false;
		return;
	}
		
	function unCheckSubscribedForums (checkbox) {
		// If all forums checkbox is checked, must check all the individual forums, or visa versa. 
		// This involves some fancy Javascript due to IE's proprietary DOM.
		var isW3C = false;
		var isIE = false;
		is_checked= checkbox.checked;
	 
		if (!(document.all)) isW3C=true; /* standard compliant DOM, probably */
		if (document.all) isIE=true;
		
		var element_name = new String();
		
		// Check/Uncheck for IE DOM
		if (isIE) {
			for(i=0;i<dynamicforums.children.length;i++) {
				thisobject = dynamicforums.children[i];
				element_name = thisobject.name;
				if(element_name != null) {
					if(element_name.substr(0,5) == "forum")
						thisobject.checked = is_checked;
				}
			}
		}
		
		// Check/Uncheck for Mozilla / W3C Compatible DOM
		if (isW3C) { 
			var x = document.getElementById('dynamicforums');
			for(i=0;i<x.childNodes.length;i++) {
				thisobject = x.childNodes[i];
				element_name = thisobject.name;
 					if(element_name != null) {
					if(element_name.substr(0,5) == "forum")
				   		thisobject.checked = is_checked;
				}
			}
		}
		
		return true;
	}
	
	function check_word_size (field) {
		size = field.value;
		if (isNaN(size))
		{
			if (size != '{MAX_SIZE}')
			{
				alert("{SIZE_ERROR}");
				field.focus();
			}
		}
		else
		{
			if (size < 1) {
				alert("{SIZE_ERROR}");
				field.focus();
			}
		}
	}
	
	function switch_visible (field) {
		var x=document.getElementById("count_limit_box");
		if (field.selectedIndex == 3)
		{
			x.style.visibility = 'visible';
		}
		else
		{
			x.style.visibility = 'hidden';
		}
	}
	
	function createURL() {
	
		// Creates a URL for display to be used by the newsreader to actually retrieve the newsfeed.
		var isW3C = false;
		var isIE = false;
		var num_checked;
		var process_form;
		var forum_string = "";
		var logged_in = {LOGGED_IN};
         
		if (!(document.all)) isW3C=true; /* standard compliant DOM, probably */
		if (document.all) isIE=true;
		num_checked = 0;
		process_form = true;

		// Check/Uncheck for IE DOM
		var element_name = new String();
		if (isIE) {
			for(i=0;i<dynamicforums.children.length;i++) {
				thisobject = dynamicforums.children[i];
				element_name = thisobject.name;
				if(element_name != null) {
					if(element_name.substr(0,5) == "forum") {
						if (thisobject.checked == true) {
							num_checked++;
							forum_string = forum_string + "&forum=" + element_name.substr(6);
						}
					}
				}
			}
		}
		
		if (isW3C) { // Check/Uncheck for Mozilla / W3C Compatible DOM
			var x = document.getElementById('dynamicforums');
			for(i=0;i<x.childNodes.length;i++) {
				thisobject = x.childNodes[i];
				element_name = thisobject.name;
				if(element_name != null) {
					if(element_name.substr(0,5) == "forum") {
						if (thisobject.checked == true) {
							num_checked++;
							forum_string = forum_string + "&forum=" + element_name.substr(6);
						}
					}
				}
			}
		}
		
		// If no forums were checked there is no point in generating a URL. Instead, give a Javascript warning
		// and generate nothing.
		if ((num_checked==0) && (document.news.all_forums.checked==false)) {
			alert("{NO_FORUMS_SELECTED}");
			return false;
		}
		else {
			// create the URL
			url = "{SITE_URL}smartfeed.{PHPEXT}?";
			if (logged_in)
			{
				url = url + "u={USER_ID}";
				// <!-- BEGIN switch_required_ip_authentication -->
				url = url + "&p={PWD_WITH_IP}";
				// <!-- END switch_required_ip_authentication -->
				// <!-- BEGIN switch_no_required_ip_authentication -->
				if (document.news.ip_auth[0].checked == true)
				{
					url = url + "&p={PWD_WITH_IP}";
				}
				else
				{
					url = url + "&p={PWD}";
				}
				// <!-- END switch_no_required_ip_authentication -->
				if (document.news.remove_yours[0].checked == true)
				{
					url = url + "&removemine=1";
				}
			}
			if (logged_in)
			{
				url = url + "&feed_type=" + document.news.feed_type.options[document.news.feed_type.selectedIndex].value;
			}
			else
			{
				url = url + "feed_type=" + document.news.feed_type.options[document.news.feed_type.selectedIndex].value;
			}
			limit = document.news.post_limit.value;
			url = url + "&limit=" + limit;
			if (document.news.sort_by.options[0].selected == true)
			{
				url = url + "&sort_by=standard";
			}
			else 
			{
				if (document.news.sort_by.options[1].selected == true)
				{
				url = url + "&sort_by=standard_desc";
				}
				else 
				{
					if (document.news.sort_by.options[2].selected == true)
					{
						url = url + "&sort_by=postdate";
					}
					else
					{
						if (document.news.sort_by.options[3].selected == true)
						{
							url = url + "&sort_by=postdate_desc";
							if (document.getElementById("count_limit_box").style.visibility == 'visible')
							{
								if (document.getElementById("count_limit").value != 'All')
								{
									url = url +"&count_limit=" + document.getElementById("count_limit").value;
								}
							}
						}
					}
				}
			}
			if (document.news.topicsonly[0].checked == true)
			{
				url = url + "&topicsonly=1";
			}
			if (logged_in)
			{
				if (document.news.lastvisit[0].checked == true)
				{
					url = url + "&lastvisit=1";
				}
			}
			if ((document.news.all_forums.checked==false) && (num_checked > 0))
			{
				url = url + forum_string;
			}
			url = url + "&max_word_size=" + document.news.max_word_size.value;
			document.news.url.value = encodeURI(url);
			return true;
		}
		
	}	
    // End hiding -->  
    </script>

    <h1 style="text-align:center"><span class="gen">{PAGE_TITLE}</span></h1>

	<form name="news" id="news" action="#" method="post">
	<table class="forumline" align="center">
	  <tr>
		<td class="row2" colspan="2" style="padding: 5px;"><span class="gen">
			<!-- BEGIN switch_not_logged_in -->
			{NOT_LOGGED_IN_MSG}<br /><br />
			<!-- END switch_not_logged_in -->
			{SMARTFEED_EXPLANATION}
		</span></td>
	  </tr>
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen"><label for="feed_type">{L_FEED_TYPE}</label></span></td>
		<td class="row2" style="padding: 5px;"><span class="gen">
		  <select name="feed_type" id="feed_type">
			<option value="{L_ATOM_10_VALUE}" selected="selected">{L_ATOM_10}</option>
			<option value="{L_RSS_20_VALUE}">{L_RSS_20}</option>
			<option value="{L_RSS_10_VALUE}">{L_RSS_10}</option>
			<option value="{L_RSS_091_VALUE}">{L_RSS_091}</option>
		  </select></span>
		</td>
	  </tr>
	  <!-- BEGIN switch_logged_in -->
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen">{L_LASTVISIT}</span></td>
		<td class="row2" style="padding: 5px;"><span class="gen">
		  <input type="radio" name="lastvisit" id="lastvisit1" checked="checked" value="YES" /> <label for="lastvisit1">{L_YES}</label>
		  <input type="radio" name="lastvisit" id="lastvisit2" value="NO" /> <label for="lastvisit2">{L_NO}</label></span>
		</td>
	  </tr>
	  <!-- END switch_logged_in -->
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen"><label for="post_limit">{L_LIMIT}</label></span></td>
		<td class="row2" style="padding: 5px;"><span class="gen">
		  <select name="post_limit" id="post_limit">
			<option value="{L_LAST_FETCH_VALUE}" selected="selected">{L_LAST_FETCH}</option>
			<option value="{L_WEEK_VALUE}">{L_WEEK}</option>
			<option value="{L_DAY_VALUE}">{L_DAY}</option>
			<option value="{L_12_HRS_VALUE}">{L_12_HRS}</option>
			<option value="{L_6_HRS_VALUE}">{L_6_HRS}</option>
			<option value="{L_3_HRS_VALUE}">{L_3_HRS}</option>
			<option value="{L_1_HRS_VALUE}">{L_1_HRS}</option>
			<option value="{L_30_MIN_VALUE}">{L_30_MIN}</option>
			<option value="{L_15_MIN_VALUE}">{L_15_MIN}</option>
		  </select></span>
		</td>
	  </tr>
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen"><label for="sort_by">{L_SORTBY}</label></span></td>
		<td class="row2" style="padding: 5px;">
		  <span class="gen"><select name="sort_by" id="sort_by" onclick="switch_visible(this);" >
			<option value="standard" selected="selected">{L_FORUMTOPIC}</option>
			<option value="standard_desc">{L_FORUMTOPIC_DESC}</option>
			<option value="postdate">{L_POSTDATE}</option>
			<option value="postdate_desc">{L_POSTDATE_DESC}</option>
		  </select></span>
		  <div id="count_limit_box" style="visibility:hidden">
		  	<p>{L_COUNT_LIMIT}</p>
			<input type="text" name="count_limit" id="count_limit" value="{MAX_SIZE}" onblur="check_word_size(this);" />
		  </div>
		</td>
	  </tr>
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen">{L_TOPICSONLY}</span></td>
		<td class="row2" style="padding: 5px;">
		  <span class="gen"><input type="radio" name="topicsonly" id="topicsonly1" value="YES" /> <label for="topicsonly1">{L_YES}</label>
		  <input type="radio" name="topicsonly" id="topicsonly2" checked="checked" value="NO" /> <label for="topicsonly2">{L_NO}</label></span>
		</td>
	  </tr>
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen"><label for="max_word_size">{L_MAX_WORD_SIZE}</label></span></td>
		<td class="row2" style="padding: 5px;">
			<input type="text" name="max_word_size" id="max_word_size" value="{MAX_SIZE}" onblur="check_word_size(this);" />
		</td>
	  </tr>
	  <!-- BEGIN switch_logged_in -->
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen">{L_REMOVE_YOUR_POSTS}</span></td>
		<td class="row2" style="padding: 5px;">
		  <span class="gen"><input type="radio" name="remove_yours" id="remove_yours1" value="YES" /> <label for="remove_yours1">{L_YES}</label>
		  <input type="radio" name="remove_yours" id="remove_yours2" checked="checked" value="NO" /> <label for="remove_yours2">{L_NO}</label></span>
		</td>
	  </tr>
	  <!-- END switch_logged_in -->
	  <!-- BEGIN switch_no_required_ip_authentication -->
	  <tr>
		<td class="row1" style="padding: 5px;"><span class="gen">{L_IP_AUTHENTICATION}</span></td>
		<td class="row2" style="padding: 5px;">
		  <span class="gen"><input type="radio" name="ip_auth" id="ip_auth1" value="YES" /> <label for="ip_auth1">{L_YES}</label>
		  <input type="radio" name="ip_auth" id="ip_auth2" checked="checked" value="NO" /> <label for="ip_auth2">{L_NO}</label></span>
		</td>
	  </tr>
	  <!-- END switch_no_required_ip_authentication -->
	  <tr>
		<td valign="top" class="row1" style="padding: 5px;"><span class="gen">{L_FORUM_SELECTION}</span></td>
		<td class="row2" style="padding: 5px;">
		  <input type="checkbox" name="all_forums" id="all_forums" checked="checked" onclick="unCheckSubscribedForums(this);" /> <label for="all_forums"><span class="gen">{L_ALL_SUBSCRIBED_FORUMS}</span></label><br />
		  <div id="dynamicforums">
			<!-- BEGIN forums -->
			<input type="checkbox" checked="checked" name="{forums.FORUM_NAME}" id="{forums.FORUM_NAME}" onclick="unCheckAllForums ();" /> <label for="{forums.FORUM_NAME}"><span class="gen">{forums.FORUM_LABEL} {forums.FORUM_AUTH}</span></label><br />
			<!-- END forums -->
		  </div>
		</td>
	  </tr>
	  <tr>
		<td colspan="2" align="center" class="catBottom" height="28"><span class="gen"><button type="button" class="mainoption" onclick="createURL();">{L_SUBMIT}</button>&nbsp;<button type="reset" class="liteoption">{L_RESET}</button></span></td>
	  </tr>
	  <tr>
		<td colspan="2" class="row2" style="padding: 5px;"><span class="gen"><label for="url">{L_URL}</label></span></td>
	  </tr>
	  <tr>
		<td colspan="2" align="center" class="row1" style="padding: 5px;"><span class="gen"><input type="text" name="url" id="url" size="120" maxlength="3000" /></span></td>
	  </tr>
	</table>
	</form> 

Posted: Mon Oct 09, 2006 1:47 pm
by YAHOOFANCLUB
MarkDHamill wrote:
YAHOOFANCLUB wrote:I want to add RSS button inside each forum with a link to the RSS FEED of that forum. Do you know any MOD like that.


Assuming you are using Smartfeed, I don't know of anyone who has written something like this. There are other newsfeed mods out there, just less sophisticated, so there may be something from searching the Mods database.

In principle it would not be a hard thing to create since most of the public URL is already known, so it would just be a matter of inserting the proper forum ID for the forum parameter.


Well I have similar thing with some VB forums like www.daniweb.com that site has feed url in front of each forum as well inside every forum. Is it really hard to create something like that. Is there no MOD available similar to that ??

Posted: Mon Oct 09, 2006 7:31 pm
by EwaldB
Some newsreaders like f. e. Yeahreader have Problems with generated URLs and are not able to read the complete Post.

Feadvalidator recomends some changes
http://feedvalidator.org/check.cgi?url= ... size%3DAll

Posted: Mon Oct 09, 2006 9:00 pm
by MarkDHamill
Thanks. It's pretty hard to remove all warnings although I used feedvalidator.org to validate my feeds. A lot of times the content itself can cause problems.

Posted: Tue Oct 10, 2006 10:31 am
by YAHOOFANCLUB
So, it there can solve in my case. Please help me. Without that link in front of each forum SmartFEED mod is not of big use to me. Please help me.

Posted: Tue Oct 10, 2006 2:52 pm
by EwaldB
@YAHOOFANCLUB
I'm not sure I understand your problem, but if I'm right you may try to modify http://www.phpbb.com/phpBB/viewtopic.php?t=151755.

I, for my self, prefer Marks solution, giving the user the ability to select himself the forums he want to read in only one form.

Posted: Tue Oct 10, 2006 3:51 pm
by YAHOOFANCLUB
alright I'll try it out.

Posted: Tue Oct 10, 2006 4:59 pm
by YAHOOFANCLUB
That Mod is really great one. Just one more question. Is there any way to add different link to the different Images in front forums.

Posted: Tue Oct 10, 2006 9:05 pm
by EwaldB
Maybe it's possible to use a constant value for the XML-icon and rewrite the mod to use the imagepath variable as variable for the rssfeed of the forum. But I'm not ableto script that. :-(

Posted: Wed Oct 11, 2006 3:42 am
by YAHOOFANCLUB
Hi EwaldB,
I have posted a request that thread. Maybe that Author might reply me. Anyhow thanx man. :wink:

Posted: Sun Oct 15, 2006 9:13 am
by tekguru
MarkDHamill wrote: What changes did you apply to smartfeed_url_body.tpl to make this condition go away?


Did we ever get an answer to this one?

Posted: Sun Oct 15, 2006 1:22 pm
by MarkDHamill
No, but it looks like copying and pasting (overwriting the code) posted here worked for at least one person. This makes me suspect it is a problem of transferring files, perhaps sending text files as binary.

Obviously it doesn't happen for me and many others.

Posted: Sun Oct 15, 2006 3:26 pm
by tekguru
Hi Mark, the good news is that it is now working for me, the only things changed were the fixing of the code shown on the previous page and recopying the data over.

Weird if it is the later as I've never seen this sort of problem before in FTP'ing any file in to place.

The only problem I have now is with BBCodes. As I run a customised system which uses a lot of third party smilies, and BBCodes, eg colour codes, etc we get the posts coming out as per:

img:1c4b0b847a]http://www.4winmobile.com/news/Falcon.gif[/img:1c4b0b847a]

for an image, and similat for BBCodes. Any ideas which part of the Mod I need to look at to see if it can take into account the 'standard' non-standard BBCodes used on the rest of the site (if that makes sense)?