Smartfeed

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
38
76%
Very Good
7
14%
Good
5
10%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 50

User avatar
MarkDHamill
Registered User
Posts: 3954
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sat Oct 07, 2006 7:16 pm

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.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

EwaldB
Registered User
Posts: 39
Joined: Sun Mar 02, 2003 2:50 pm

Post by EwaldB » Sun Oct 08, 2006 8:30 pm

It works fine! Thank you!
Regards,
EwaldB

Image

User avatar
MarkDHamill
Registered User
Posts: 3954
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sun Oct 08, 2006 9:23 pm

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> 
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

YAHOOFANCLUB
Registered User
Posts: 48
Joined: Thu Oct 05, 2006 11:43 am
Contact:

Post by YAHOOFANCLUB » Mon Oct 09, 2006 1:47 pm

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 ??

EwaldB
Registered User
Posts: 39
Joined: Sun Mar 02, 2003 2:50 pm

Post by EwaldB » Mon Oct 09, 2006 7:31 pm

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
Regards,
EwaldB

Image

User avatar
MarkDHamill
Registered User
Posts: 3954
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Mon Oct 09, 2006 9:00 pm

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.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

YAHOOFANCLUB
Registered User
Posts: 48
Joined: Thu Oct 05, 2006 11:43 am
Contact:

Post by YAHOOFANCLUB » Tue Oct 10, 2006 10:31 am

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.

EwaldB
Registered User
Posts: 39
Joined: Sun Mar 02, 2003 2:50 pm

Post by EwaldB » Tue Oct 10, 2006 2:52 pm

@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.
Regards,
EwaldB

Image


YAHOOFANCLUB
Registered User
Posts: 48
Joined: Thu Oct 05, 2006 11:43 am
Contact:

Post by YAHOOFANCLUB » Tue Oct 10, 2006 4:59 pm

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.

EwaldB
Registered User
Posts: 39
Joined: Sun Mar 02, 2003 2:50 pm

Post by EwaldB » Tue Oct 10, 2006 9:05 pm

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. :-(
Regards,
EwaldB

Image

YAHOOFANCLUB
Registered User
Posts: 48
Joined: Thu Oct 05, 2006 11:43 am
Contact:

Post by YAHOOFANCLUB » Wed Oct 11, 2006 3:42 am

Hi EwaldB,
I have posted a request that thread. Maybe that Author might reply me. Anyhow thanx man. :wink:

User avatar
tekguru
Registered User
Posts: 139
Joined: Thu Jul 03, 2003 1:33 pm

Post by tekguru » Sun Oct 15, 2006 9:13 am

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?

User avatar
MarkDHamill
Registered User
Posts: 3954
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sun Oct 15, 2006 1:22 pm

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.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
tekguru
Registered User
Posts: 139
Joined: Thu Jul 03, 2003 1:33 pm

Post by tekguru » Sun Oct 15, 2006 3:26 pm

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)?

Post Reply

Return to “[2.0.x] MOD Database Releases”