News images

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
midway31
Forum Members
Forum Members
Posts: 108
Joined: Fri Nov 23, 2007 1:11 am

News images

Post by midway31 »

This is my summary news template with a field definition of thumb however seeing as I am updating a site with lots of previous news articles it is throwing errors as they did not have thumbs done this way. What do I have to change to only show thumbs if added.
Warning: file_get_contents(http://www.dantehan.com.au/new2/uploads/news/id338/) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/dantehan/public_html/new2/modules/CGSmartImage/lib/class.cgsi_utils.php on line 365

Notice: Could not find a file at: http://www.dantehan.com.au/new2/uploads/news/id338/ in /home/dantehan/public_html/new2/modules/CGSmartImage/action.default.php on line 44
You can see it the problem here:
http://www.dantehan.com.au/new2/index.p ... und-wannon

Code: Select all

{strip}

<!-- .news-summary wrapper -->
<article class='news-summary'>

    {foreach from=$items item='entry'}
    <!-- .news-article (wrapping each article) -->
    <section class='news-article'>
        <header>
            <div class='meta cf'>
                <time class='date' datetime='{$entry->postdate|date_format:'%Y-%m-%d'}'>
                    <span class='day'> {$entry->postdate|date_format:'%d'} </span>
                    <span class='month'> {$entry->postdate|date_format:'%b'} </span>
                </time><h2><a href='{$entry->moreurl}' title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a> </h2>
           
                
                <span class='category'> {$category_label} {$entry->category}</span>
            </div>
        </header>
        {if $entry->summary}<div class='left'>
           {CGSmartImage filter_resize='h,80' quality='85'  src="{$entry->file_location}/{$entry->fieldsbyname.thumb->value}"}</div> <p>{eval var=$entry->summary|strip_tags}</p>
            <span class='more'>{$entry->morelink} →</span>
        {else if $entry->content}
            <p>{eval var=$entry->content|strip_tags}</p>
        {/if}
    </section>
    <!-- .news-article //-->
    {/foreach}
      
</article>
<!-- .news-summary //-->

{/strip}
midway31
Forum Members
Forum Members
Posts: 108
Joined: Fri Nov 23, 2007 1:11 am

Re: News images

Post by midway31 »

All sorted thanks. Just changed the code to this

Code: Select all

{strip}

<!-- .news-summary wrapper -->
<article class='news-summary'>

    {foreach from=$items item='entry'}
    <!-- .news-article (wrapping each article) -->
    <section class='news-article'>
        <header>
            <div class='meta cf'>
                <time class='date' datetime='{$entry->postdate|date_format:'%Y-%m-%d'}'>
                    <span class='day'> {$entry->postdate|date_format:'%d'} </span>
                    <span class='month'> {$entry->postdate|date_format:'%b'} </span>
                </time><h2><a href='{$entry->moreurl}' title='{$entry->title|cms_escape:htmlall}'>{$entry->title|cms_escape}</a> </h2>
           
                
                <span class='category'> {$category_label} {$entry->category}</span>
            </div>
        </header>
        {if $entry->summary} <p>{if $entry->fieldsbyname.thumb->value}<div class='left'>
           {CGSmartImage filter_resize='h,80' quality='85'  src="{$entry->file_location}/{$entry->fieldsbyname.thumb->value}"}</div>{/if}{eval var=$entry->summary|strip_tags}</p>
            <span class='more'>{$entry->morelink} →</span>
        {else if $entry->content}
            <p>{eval var=$entry->content|strip_tags}</p>
        {/if}
    </section>
    <!-- .news-article //-->
    {/foreach}
      
</article>
<!-- .news-summary //-->

{/strip}
Post Reply

Return to “Modules/Add-Ons”