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
tekguru
Registered User
Posts: 139
Joined: Thu Jul 03, 2003 1:33 pm

Post by tekguru » Sun Oct 15, 2006 4:30 pm

It looks like to get the missing functionality on the BBCodes, etc I need to add in the foillowing lines - note some will be corrupted due to the parsing on site here.

Code: Select all

    // [code] and [ /CODE ] for posting code (HTML, PHP, C etc etc) in your posts.
    $post_text =str_replace("[code:1:$uid]","", $post_text);
    $post_text =str_replace("[/code:1:$uid]", "", $post_text);
    $post_text =str_replace("[code:$uid]", "", $post_text);
    $post_text =str_replace("[/code:$uid]", "", $post_text);

    // [quote]
and
[/quote]  for posting replies with quote, or just for quoting stuff.
    $post_text =str_replace("[quote:1:$uid]","", $post_text);
    $post_text =str_replace("[/quote:1:$uid]", "", $post_text);
    $post_text =str_replace("[quote:$uid]", "", $post_text);
    $post_text =str_replace("[/quote:$uid]", "", $post_text);
    // New one liner to deal with opening quotes with usernames...
    // replaces the two line version that I had here before..
    $post_text =preg_replace("/\[quote:$uid=(?:\"?([^\"]*)\"?)\]/si", "", $post_text);
    $post_text =preg_replace("/\[quote:1:$uid=(?:\"?([^\"]*)\"?)\]/si", "", $post_text);

    // [list] and [list=x] for (un)ordered lists.
    // unordered lists
    $post_text =str_replace("[list:$uid]", "", $post_text);
    // li tags
    $post_text =str_replace("[*:$uid]", "", $post_text);
    // ending tags
    $post_text =str_replace("[/list:u:$uid]", "", $post_text);
    $post_text =str_replace("[/list:o:$uid]", "", $post_text);
    // Ordered lists
    $post_text =preg_replace("/\[list=([a1]):$uid\]/si", "", $post_text);

    // colours
    // $post_text =preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", "", $post_text);
    // $post_text =str_replace("[/color:$uid]", "", $post_text);

    // url #2
    $post_text =str_replace("[url]","", $post_text);
    $post_text =str_replace("[/url]", "", $post_text);

    // url /\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\](.*?)\[/url\]/si
    $post_text =preg_replace("/\[url=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\]/si", "", $post_text);
    $post_text =str_replace("[/url:$uid]", "", $post_text);

    // img
    $post_text =str_replace("[img:$uid]","", $post_text);
    $post_text =str_replace("[/img:$uid]", "", $post_text);

    // email
    $post_text =str_replace("[email:$uid]","", $post_text);
    $post_text =str_replace("[/email:$uid]", "", $post_text);

    // size
    $post_text =preg_replace("/\[size=([\-\+]?[1-2]?[0-9]):$uid\]/si", "", $post_text);
    $post_text =str_replace("[/size:$uid]", "", $post_text);

    // align
    $post_text =preg_replace("/\[align=(left|right|center|justify):$uid\]/si", "", $post_text);
    $post_text =str_replace("[/align:$uid]", "", $post_text);

    // [b] and [/b] for bolding text.
    $post_text =str_replace("[b:$uid]","", $post_text);
    $post_text =str_replace("[/b:$uid]", "", $post_text);

    // [u] and [/u] for underlining text.
    $post_text =str_replace("[u:$uid]", "", $post_text);
    $post_text =str_replace("[/u:$uid]", "", $post_text);

    // [i] and [/i] for italicizing text.
    $post_text =str_replace("[i:$uid]", "", $post_text);
    $post_text =str_replace("[/i:$uid]", "", $post_text);

	// [acronym] and [/acronym] for italicizing text.
    $post_text =str_replace("[acronym:$uid=([a-z0-9\-\.,\?!%\*_\/:;~\\&$@\/=\+]+)\]/si", "", $post_text);
    $post_text =str_replace("[/acronym:$uid]", "", $post_text);
But alas adding this into the parsing makes no difference. Any ideas at all?

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

Post by tekguru » Sun Oct 15, 2006 4:44 pm

You can see an example of the messed up BB and images codes here:

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 15, 2006 7:53 pm

Thanks Tekguru. I hope to put out a new version in the coming weeks, and I expect I will steal some of this code.
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 8:08 pm

I hopeit helps and it useful to you. As I say I added it in and no difference was seen at all.

As an interim any ideas why adding the above did not work?

If you want the original piece of code that this was extracted from please drop me an email / PM and I'll send it over in teh origianl format - might be useful as there is a lot of other code in there which you may wan to take on board too!

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 9:02 pm

Well, this code:

Code: Select all

 //  and  for italicizing text.
$post_text =str_replace("[i:$uid]", "", $post_text);
$post_text =str_replace("[/i:$uid]", "", $post_text); 
Simply replaces the Italics BBCode with an empty string. That's great for removing italics, but essentially it needs to be translated into HTML by wrapping a <i> and </i> around $post_text.

So I would imagine something like this would work:

Code: Select all

$post_text =str_replace("[i:$uid]", "<i>", $post_text);
$post_text =str_replace("[/i:$uid]", "</i>", $post_text); 
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 » Mon Oct 16, 2006 6:10 am

Cheers Mark, I see what you mean, as a lot of the codes work in that way, i.e. stripping data, but then again is including that sort of formatting not against the RSS standards (no ideas myself but it seems logical).

A few other points in the following:

Image


- In the title is there any easy way of removing the forum title that is 'Site Feedback' as in some feed snippet readers - like Vista Sidebar - that stops the topic core information being visible.

- Similarly as the second line contains the data on who made the post, is it needful in the title and again can it be removed.

- In the third line again the time and poster data is shown, and again I think this is not needful as it has already been shown in the second line.

- The BBCode issues I seem to be having are mainly where users have used the specialist BBCodes to create 'posh' signatures, and as this data is really not needful how can the sig be removed from the post?

For me at least if the above could be addressed it would result in a mich tighter cleaner feed.

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 16, 2006 11:56 pm

This line 588 on smartfeed.php controls what appears for the item title:

Code: Select all

				$item->title = ($row['post_subject'] == '') ? entity_decode($row['forum_name'] . ' :: ' . $row['topic_title']) : entity_decode($row['forum_name'] . ' :: ' . $row['post_subject']);
				if ($row['topic_first_post_id'] <> $row['post_id'])
				{
					$item->title .= ' :: ' . $lang['smartfeed_reply'] . ' ' . $lang['smartfeed_by'] . ' ' . $row['username'];
				}
If there is a post subject, that is used.

On Line 612 this puts out the blurb you see at the top of the message. Remember, if this is not present there is no way to know who sent the post.

Code: Select all

				$post_text = '<em>' . $row['username'] . '</em> ' . $lang['smartfeed_wrote'] . ' ' . $lang['smartfeed_at'] . ' <em>' . date(SMARTFEED_DATE_FORMAT,$row['post_time']) . ' ' . $timezone . '</em>: ' . $post_text;
I don't know how to make non-standard bbCode show up. It could be researched I guess. If anyone has an idea, pass it on. I write this mod as all of them as working on a standard phpBB install.

I'll see what I can do to allow a user to specify other default formats in future versions.
tekguru wrote: - In the title is there any easy way of removing the forum title that is 'Site Feedback' as in some feed snippet readers - like Vista Sidebar - that stops the topic core information being visible.

- Similarly as the second line contains the data on who made the post, is it needful in the title and again can it be removed.

- In the third line again the time and poster data is shown, and again I think this is not needful as it has already been shown in the second line.

- The BBCode issues I seem to be having are mainly where users have used the specialist BBCodes to create 'posh' signatures, and as this data is really not needful how can the sig be removed from the post?

For me at least if the above could be addressed it would result in a mich tighter cleaner feed.
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 » Tue Oct 17, 2006 5:02 am

According to tekgurus problems (and in part mine too :) ):

I really know nothing about coding, but it's maybe helpfull to take a look on poular fully modded phpBB boards, like for example plus 1.53, orion or others.
They have a few additional bbcodes integrated.
If you like, I'll give full access to a ready installed plus 1.53 testboard for tests icluding ftp too.
Regards,
EwaldB

Image

eleni1
Registered User
Posts: 4
Joined: Mon Oct 23, 2006 9:12 am

Greek in smartfeed

Post by eleni1 » Mon Oct 23, 2006 1:42 pm

I hope I'm in the right topic :)

I have managed to have greek text in the smartfeed.
Unfontunately I had to change the feedcreator.class.php cause it seems to ingore the SMARTFEED_RFC1766_LANG variable.

So the change I made is
Line 626 in feedcreator.class.php
var $encoding = "ISO-8859-7";

instead of var $encoding = "ISO-8859-1";

I guess there could be a way of setting it by variable, but I don't know it.

Elena

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 23, 2006 2:44 pm

In my latest version I allow this to be set in /includes/smartfeed_constants.php.

Code: Select all

define('SMARTFEED_RFC1766_LANG', 'en-US'); // Language of feed content. Use only values at http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
This might work.

I might be able to override the feedcreator class.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

senyafin
Registered User
Posts: 69
Joined: Wed Jul 05, 2006 5:53 pm
Contact:

Post by senyafin » Mon Oct 23, 2006 3:27 pm

Using phpBB+aphrodite_mc style + XS bbcode
smartfeed.php

Code: Select all

  <?xml version="1.0" encoding="ISO-8859-1" ?> 
- <!--  generator="SmartFeed phpBB Modification 1.0.5 (mhamill@computer.org)" 
  --> 
- <rss version="0.91">
- <channel>
  <title>www.mydomain.com</title> 
  <description /> 
  <link>http://www.mydomain.com/forum/smartfeed.php</link> 
  <lastBuildDate>Mon, 23 Oct 2006 17:10:25 +0100</lastBuildDate> 
  <generator>SmartFeed phpBB Modification 1.0.5 (mhamill@computer.org)</generator> 
  <language>en-US</language> 
  <pubDate>Mon, 23 Oct 2006 15:10:25 +0100</pubDate> 
  <ttl>60</ttl> 
- <item>
  <title>Error in your SmartFeed URL</title> 
  <link>http://www.mydomain.com/forum/smartfeed.php</link> 
  <description>There is an error in the URL you used to retrieve this newsfeed. As a result, no content can be returned. Use this error information as a guide to correcting the problem. Please note that you must use <a href="http://www.mydomain.com/forum/smartfeed_url.php">this program</a> to create a URL that can be used with SmartFeed. The error is: This program requires arguments.</description> 
  </item>
  </channel>
  </rss
Could someone helps me tp fixed that problem or at least an advice if it works with aphrodite and XS bbcode

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 23, 2006 4:49 pm

The answer is right there in the error message.
The error is: This program requires arguments.


Simply read the installation instructions. smartfeed_url.php is used to construct the URL which smartfeed.php interprets.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

senyafin
Registered User
Posts: 69
Joined: Wed Jul 05, 2006 5:53 pm
Contact:

Post by senyafin » Mon Oct 23, 2006 5:28 pm

Hello Mark,

SmartFeed is easy to install and with the deafult settings it should works.
I had installed it on a plain vanilla a few weeks ago and i got no problems.
A few weeks ago i've changed the style and now it wont work.
That'S why i've asked.

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 23, 2006 6:19 pm

Not sure what you mean by "style".

Unless you copied and pasted wrong, it looks like the rss tag isn't closing.

Code: Select all

</rss
I used feedvalidator.org to validate.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

senyafin
Registered User
Posts: 69
Joined: Wed Jul 05, 2006 5:53 pm
Contact:

Post by senyafin » Wed Oct 25, 2006 3:32 pm

With Seamonkey i get an additional info
The error is: The "u" parameter must be used with the "p"


Maybe that is the source why it wont work?
Could you please give me explanation what is meant.
Tia

Post Reply

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