Elcan Software

Small software, big solutions.

Home arrow Support Forum
Support Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Fix intro and main text being the same (1 viewing) (1) Guest
Help for feed2post
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Fix intro and main text being the same
#182
bbox (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Customisations 9 Months, 3 Weeks ago Karma: 0  
Hi,
I'm looking to make some automatic changes and additions to the feeds I'm posting, due to agreements that my client has with content providers. I haven't seen mention of the specific functionality so I assume it's not built in. I'm just wondering if you could point me to the code that I should update.

I need to adjust the content before it's entered into the database in a number of ways: I need to limit the amount of content taken from the external site to 100 words; we require a javascript warning dialog to inform users any links are to an external site, when they click on the link; and each post needs to have a disclaimer for the content coming from an external site.

I'm also looking to set the created_by_alias field for the post, using a specific name for each feed. The names aren't users in Joomla.

These may be considerations for future releases but, for the moment, I'm hoping you can direct me to the part of code that I can incorporate these changes.

An example of what we're looking for - which has been manually edited - is at http://ieatidrinkiwork.com.au/index.php?option=com_content&task=view&id=6302&Itemid=1
Here's a post taken through Feed2Post 1.3.1: http://ieatidrinkiwork.com.au/index.php?option=com_content&task=view&id=6347&Itemid=1

You may notice the content is repeated there in the intro and body of the post. It looks like the update to 1.3.2 has taken care of that problem. However, as I was testing that fix, I noticed this error: "A feed could not be found at http://tankeduptaco.blogspot.com/atom.xml"
although the posts do display for selection.

Is there a full changelog from the 1.3 branch to the version 2 branch? From the description in the details, it seems that the only difference is that version 2 is J! 1.5.1 native. The other features listed on the details page look like they're all included in v1.3.2.

Thanks,
Brett
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#187
adminmario (Admin)
Admin
Posts: 90
graphgraph
User Offline Click here to see the profile of this user
Re:Customisations 9 Months, 3 Weeks ago Karma: -1  
Dear bbox, I'm glad you found my software useful, to adjust the text size, you need to change the text that get's into the posted item, at save time, to do so, you can do (search the code up to line numbers listed):
Code:

329: $row->introtext = str_replace( '<br>', '<br />', $introText ); //add this line 330: $row->introText = substr($row->introtext,100);
that line will limit to 100 chars the text, you can change that 100 and make it at please, to solve the repeated text, disable full-text fetching as that feed seems that it's not supporting full-text content. To change the "created by": you can't as it has to be a joomla user ID there...but you can create a few "fake" users for joomla and make the names appear there by selecting their IDs. I've had no time yet to make a full change log for version 2.0 and either for 1.3.2, but they are almost the same, except that 2.0 includes the import utility to get feed adresses from newsfeeds component. I'll compile a list soon. best regards, hope that this information can be of help. Mario
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#779
patrickegan (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Fix intro and main text being the same 5 Months, 1 Week ago Karma: 0  
Thanks for the information. I have added a bit to the code you mentioned.

The problem was that some blogs were not getting the intro shortened, so that the intro text was the same length as the main text. This only happen on blogs from blogspot, and blogger. So I wrote code to check and see if the intro text is less than 1200 characters. If it is larger than that, then it did not get shortened, and so I shortened it to 1000 characters.

Joomla! 1.0.13 Stable
Feed2post: 1.5
line 450 in admin.feedpost.php
Code:

$introTxt = str_replace( '<br>', '<br />', $introText ); if (strlen($introTxt) > 1200) { $introTxt = substr($introTxt,0,1000); $row->introtext = $introTxt . "[...]"; } else { $row->introtext = $introTxt; }
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/08/12 16:11 By patrickegan.
  The administrator has disabled public write access.
#789
movilla (Admin)
Admin
Posts: 279
graph
User Online Now Click here to see the profile of this user
Re:Fix intro and main text being the same 5 Months ago Karma: 1  
Thanks for the feedback, the help is much appreciated.

Best regards,
Mario
 
Report to moderator   Logged Logged  
 
Best regards,
Mario - Feed2post coder
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Sponsors

Your Ad Here
Joomla Templates by Joomlashack