Contentteller

Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >

Problem importing news from feed

Discussion in 'Version 1.x' started by cosmin, Jun 4, 2005.

Page 1 of 2
1 2 Next >
  1. cosmin Guest

    Problem importing news from feed

    Hi. I have some problems importing a news item from a feed, as it is getting truncated. I've looked at esselbach_st_downloadqueue, esselbach_st_stories, esselbach_st_storyqueue to check for columns that may truncate the items but still can't figure out why it happens. Also I see some websites running ST now have better search engine friendly URLs (like Major Geeks, and NTCompatible, like this http://www.ntcompatible.com/CDCheck_3.1.5.0_s48671.html)
    How do they do that? The SE friendly templates you released only allow changing the extension to html to get rid of the parameters.
    cosmin, Jun 4, 2005
    #1
  2. timbo Guest

    Problem importing news from feed

    Yeah, that search engine friendly URL is something I have been needing for a while... having-the-title-of-the-story in the URL is great for search engines.

    When can we expect to get this? I really hope this is released before 2.0.
    timbo, Jun 4, 2005
    #2
  3. Philipp Guest

    Problem importing news from feed

    I have some problems importing a news item from a feed, as it is getting truncated. I've looked at esselbach_st_downloadqueue, esselbach_st_stories, esselbach_st_storyqueue to check for columns that may truncate the items but still can't figure out why it happens
    The title or the story text? Can you give me an example.

    Also I see some websites running ST now have better search engine friendly URLs (like Major Geeks, and NTCompatible, like this http://www.ntcompatible.com/CDCheck_3.1.5.0_s48671.html)
    How do they do that? The SE friendly templates you released only allow changing the extension to html to get rid of the parameters.
    This work with mod_rewrite as well.

    Here the mod_rewrite rules for .htaccess:

    Code:
    RewriteRule ^(.*)_s([0-9]+).html$ /story.php?id=$2                              
    RewriteRule ^(.*)_p([0-9]+).html$ /printer.php?id=$2 
    Then add the following to the php part of your story/news templates:

    Code:
    $stitle = htmlentities($insert[story_title]);                                                                                                                                                                                                                                                               
    $stitles = $stitle."_s".$insert[story_id].".html";                                                               
    $stitlep = $stitle."_p".$insert[story_id].".html"; 
    and replace in the HTML part the link to the story page with $stitles and to the printer page with $stitlep. Here an example:

    Code:
    Posted by $insert[story_author] on: $insert[story_time] in category: $insert[story_category] [ <a href="$stitlep">Print</a> | <a href="$stitlel">Permalink / $insert[story_comments] Comment(s)</a
    > ]<br />
    Philipp, Jun 4, 2005
    #3
  4. cosmin Guest

    Problem importing news from feed

    I think it was a line break or whitespace problem, because after erasing some blank lines and tidying text up a bit, it comes out just fine. Weird, really. And thank you for this providing the new templates for SEF URLs. Also, I was wondering/hoping: will you do a beta release for ST 2.0 so we can see which way it's headed?
    cosmin, Jun 4, 2005
    #4
  5. timbo Guest

    Problem importing news from feed

    I must be thick as I cannot get this to work...

    Here the mod_rewrite rules for .htaccess:

    Code:
    RewriteRule ^(.*)_s([0-9]+).html$ /story.php?id=$2                              
    RewriteRule ^(.*)_p([0-9]+).html$ /printer.php?id=$2 
    Does this replace or go below the following in the existing .htaccess file:

    RewriteRule ^story.html$ story.php?id=1
    RewriteRule ^story([0-9]+).html$ story.php?id=$1
    RewriteRule ^story([0-9]+)-1.html$ story.php?id=$1
    RewriteRule ^print([0-9]+).html$ printer.php?id=$1

    ?


    Then add the following to the php part of your story/news templates:

    Code:
    $stitle = htmlentities($insert[story_title]);                                                                                                                                                                                                                                                               
    $stitles = $stitle."_s".$insert[story_id].".html";                                                               
    $stitlep = $stitle."_p".$insert[story_id].".html"; 


    Below the lines:

    <?php
    global $insert;

    in the template such as story template?

    Tried that, but the values didn't seem to go through.... which templates exactly do I need to change?

    Currently, for Read More in the news_more template I have:

    <?php
    global $insert;
    $EST_TEMPLATE = <<<TEMPLATE

    <br /><br /><a href="story$insert[story_id].html">Read more</a>

    TEMPLATE;
    ?>

    What would that change to?
    timbo, Jun 4, 2005
    #5
  6. Philipp Guest

    Problem importing news from feed

    I think it was a line break or whitespace problem, because after erasing some blank lines and tidying text up a bit, it comes out just fine.
    Can you post an example feed?

    I was wondering/hoping: will you do a beta release for ST 2.0 so we can see which way it's headed?
    Yes, a beta test is planned. I will post an announcement as soon it getting closer.

    Does this replace or go below the following in the existing .htaccess file
    It go below

    What would that change to?
    It should be $stitle = htmlentities(str_replace(" ","_",$insert[story_title])); and not $stitle = htmlentities($insert[story_title]); :eek:

    Here the code based on your example:
    Code:
    <?php 
    global $insert; 
    
    $stitle = htmlentities(str_replace(" ","_",$insert[story_title])); 
    $stitles = $stitle."_s".$insert[story_id].".html"; 
    
    $EST_TEMPLATE = <<<TEMPLATE 
    
    <br /><br /><a href="$stitles">Read more</a> 
    
    TEMPLATE; 
    ?> 
    Philipp, Jun 5, 2005
    #6
  7. timbo Guest

    Problem importing news from feed

    Originally posted by Philipp:
    Here the code based on your example:
    Code:
    <?php 
    global $insert; 
    
    $stitle = htmlentities(str_replace(" ","_",$insert[story_title])); 
    $stitles = $stitle."_s".$insert[story_id].".html"; 
    
    $EST_TEMPLATE = <<<TEMPLATE 
    
    <br /><br /><a href="$stitles">Read more</a> 
    
    TEMPLATE; 
    ?> 
    Tried that, but when I view the news page all of the news listings have gone and looking at the HTML :

    <!-- Template login_header_user -->

    <table cellspacing="0" cellpadding="0" width="100%" align="center" bgcolor="#000000" border="0">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="3" width="100%" border="0">
    <tr>
    <td bgcolor="#6493d4">
    <font face="Verdana, Helvetica, sans-serif" size="1" color="#FFFFFF">
    <b>Welcome back, user!</b>
    </font>
    </td>
    </tr>
    <tr>
    <td bgcolor="#bacfec">
    <font face="Verdana, Helvetica, sans-serif" size="1">
    Click <a href="logout.php">here</a> to logout.
    </font>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />
    and then ends abruptly.

    Is there a mistake in the code you posted?
    timbo, Jun 5, 2005
    #7
  8. Philipp Guest

    Problem importing news from feed

    Please verify that there is no whitespace character after $EST_TEMPLATE = <<<TEMPLATE
    Philipp, Jun 5, 2005
    #8
  9. timbo Guest

    Problem importing news from feed

    I did check, honestly...ahem..found one ... so that's fixed! Thanks

    Two things - It doesn't seem to cope with ? question marks in headlines - such as this?

    Secondly - how easy is it to change the _ (underscore) in the headlines to a - (dash)

    Instead of

    Philipp_is_a_genius_s971.html

    to

    Philipp-is-a-genius-s971.html

    This is probably the most amazing modification to this script... love it thanks again!
    timbo, Jun 5, 2005
    #9
  10. Philipp Guest

    Problem importing news from feed

    Two things - It doesn't seem to cope with ? question marks in headlines - such as this?

    Secondly - how easy is it to change the _ (underscore) in the headlines to a - (dash)
    This should work:

    Code:
    $stitle = str_replace(" ","-",$insert[story_title]); 
    $stitle = str_replace("?","",$stitle);
    $stitle = htmlentities($stitle);
    $stitles = $stitle."_s".$insert[story_id].".html"; 
    Philipp, Jun 6, 2005
    #10
  11. cosmin Guest

    Problem importing news from feed

    It would be great if you posted a set of modified templates with this. I'm kinda stuck trying to adapt it so it works with the download pages.
    cosmin, Jun 6, 2005
    #11
  12. timbo Guest

    Problem importing news from feed

    Yep, that works... thanks! Now to change the other templates ;)
    timbo, Jun 6, 2005
    #12
  13. Philipp Guest

    Problem importing news from feed

    It would be great if you posted a set of modified templates with this.
    This is no official modification yet.

    I'm kinda stuck trying to adapt it so it works with the download pages.
    Where do you stuck?
    Philipp, Jun 6, 2005
    #13
  14. Rushian Guest

    Problem importing news from feed

    I take it this doesn't work on IIS? :)
    Rushian, Jun 6, 2005
    #14
  15. Philipp Guest

    Problem importing news from feed

    Not with the default configuration because mod_rewrite is only available for Apache.

    However, there are similar URL rewriting extensions available for IIS:
    ISAPI_Rewrite - http://www.isapirewrite.com
    IIS Rewrite - http://www.qwerksoft.com/products/iisrewrite/
    Philipp, Jun 7, 2005
    #15
  16. Rushian Guest

    Problem importing news from feed

    Originally posted by Philipp:
    Not with the default configuration because mod_rewrite is only available for Apache.

    However, there are similar URL rewriting extensions available for IIS:
    ISAPI_Rewrite - http://www.isapirewrite.com
    IIS Rewrite - http://www.qwerksoft.com/products/iisrewrite/
    Cool, I'll look in to those.. I hate missing out on features.. ;)
    Rushian, Jun 8, 2005
    #16
  17. Philipp Guest

    Problem importing news from feed

    Here an example for the download and review section

    Review

    Add the following to your mod_rewrite .htaccess file:

    Code:
    RewriteRule ^(.*)_r([0-9]+).html$ /review.php?id=$2
    Open the template review_list in the template editor and add after:

    Code:
    <?php
    global $insert;
    the following:

    Code:
    $stitle = str_replace(" ","-",$insert[review_title]); 
    $stitle = str_replace("?","",$stitle); 
    $stitle = htmlentities($stitle); 
    $stitler = $stitle."_r".$insert[review_id].".html"; 
    Then replace:

    Code:
     <li><a href="review.php?id=$insert[review_id]">$insert[review_title]</a><br />
    with:

    Code:
     <li><a href="$stitler">$insert[review_title]</a><br />
    and save the template


    Download

    Add the following rule to your .htaccess file:

    Code:
    RewriteRule ^(.*)_d([0-9]+).html$ /download.php?det=$2
    Now open the template download_cat_page in the template editor and add after:

    Code:
    <?php
    global $insert;
    the following:

    Code:
    $stitle = str_replace(" ","-",$insert[download_title]); 
    $stitle = str_replace("?","",$stitle); 
    $stitle = htmlentities($stitle); 
    $stitled = $stitle."_d".$insert[download_id].".html"; 
    Next replace:

    Code:
     <li><a href="download.php?det=$insert[download_id]">$insert[download_title]</a><br />
    with:

    Code:
     <li><a href="$stitled">$insert[download_title]</a><br />
    and save the template
    Philipp, Jun 8, 2005
    #17
  18. timbo Guest

    Problem importing news from feed

    What would be the codes for the latest comments and search templates? Btw - thanks so much for the above !
    timbo, Jun 11, 2005
    #18
  19. cosmin Guest

    Problem importing news from feed

    Originally posted by Philipp:
    I have some problems importing a news item from a feed, as it is getting truncated. I've looked at esselbach_st_downloadqueue, esselbach_st_stories, esselbach_st_storyqueue to check for columns that may truncate the items but still can't figure out why it happens
    The title or the story text? Can you give me an example.

    Also I see some websites running ST now have better search engine friendly URLs (like Major Geeks, and NTCompatible, like this http://www.ntcompatible.com/CDCheck_3.1.5.0_s48671.html)
    How do they do that? The SE friendly templates you released only allow changing the extension to html to get rid of the parameters.
    This work with mod_rewrite as well.

    Here the mod_rewrite rules for .htaccess:

    Code:
    RewriteRule ^(.*)_s([0-9]+).html$ /story.php?id=$2                              
    RewriteRule ^(.*)_p([0-9]+).html$ /printer.php?id=$2 
    Then add the following to the php part of your story/news templates:

    Code:
    $stitle = htmlentities($insert[story_title]);                                                                                                                                                                                                                                                               
    $stitles = $stitle."_s".$insert[story_id].".html";                                                               
    $stitlep = $stitle."_p".$insert[story_id].".html"; 
    and replace in the HTML part the link to the story page with $stitles and to the printer page with $stitlep. Here an example:

    Code:
    Posted by $insert[story_author] on: $insert[story_time] in category: $insert[story_category] [ <a href="$stitlep">Print</a> | <a href="$stitlel">Permalink / $insert[story_comments] Comment(s)</a
    > ]<br />

    Thank you Philipp. I haven't sent you that feed sample because like I said it worked out in the end.
    cosmin, Jun 13, 2005
    #19
  20. Philipp Guest

    Problem importing news from feed

    Search:

    Open the template search_list_news in the template editor and add after:

    Code:
    <?php 
    global $insert;
    the following:

    Code:
    $stitle = str_replace(" ","-",$insert[story_title]); 
    $stitle = str_replace("?","",$stitle); 
    $stitle = htmlentities($stitle); 
    $stitles = $stitle."_s".$insert[story_id].".html";
    Then replace:

    Code:
    <li><a href="story.php?id=$insert[story_id]">$insert[story_title]</a> ($insert[story_time])<br />
    with:

    Code:
    <li><a href="$stitles">$insert[story_title]</a> ($insert[story_time])<br />
    Comments:

    This requires a code modification in comments.php

    Find:

    Code:
    $insert[comment_url] = "story.php?id=$insert[comment_story]";
    and replace with:

    Code:
    $stitle = str_replace(" ","-",$story); 
    $stitle = str_replace("?","",$stitle); 
    $stitle = htmlentities($stitle); 
    $insert[comment_url] = $stitle."_s".$insert[comment_story].".html";
    Philipp, Jun 13, 2005
    #20
Page 1 of 2
1 2 Next >
Tweet
Facebook:
Forgot your password?
Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >
  • Home
  • Forums

    Forums

    Quick Links
    • Search Forums
    • What's New?
  • Members

    Members

    Quick Links
    • Registered Members
    • Current Visitors
    • Recent Activity
  • Help

    Help

    Quick Links
    • Smilies
    • BB Codes
    • Trophies

Separate names with a comma.

Advanced search...
    Forum software by XenForo™ ©2011 XenForo Ltd.