Home · sNews Development · [Addon] Intro Content

CMS-ZEN.COM

online web development :: art and design :: fun stuff
best budd
Home •sNews Development cms road trip PHP Scripts Photoshop Guides Css Guides Music and video clips Art Gallery Low Light Photography Impression Photography

sNews 17 released

NEW: sNewsCMS v1.7 Release has been made available for download.
Get it while it's hot!

[Addon] Intro Content

want to add Intro content easy ?
this lil addon will display your intro content while on category page ( teaser ),
when article is in full view this content will not show.

For sNews v17 just add the function and use the FUNC in
article editor to call the function and to add your Teaser.

For sNews v1.6 Best Use with - [MOD] Function use in articles (snews1.6)  by philmoz,
Read here How to install http://snewscms.com/forum/index.php?topic=4583.0

  <?php
    
/*
        Very Simple Intro Mod for sNewsCMS v1.6/1.7 ( Auto Detected ).
        by Moshe Gil Lamberger.
        date: Jun 7, 2008 :: 23:12 ::
            website: http://www.cms-zen.com
    Note: For v1.6 Best use with (  built in 17 )
        [MOD] Function use in articles (snews1.6)  by philmoz.  
            location:  http://snewscms.com/forum/index.php?topic=4583.0
    */
    
function intro($introtxt=''){
    
// test if we are on sNews v.16 else we are on sNews v.17 , 
    // and set A Var for article id.
        
if (function_exists('get_id')) {
                
$_ID get_id('article');
            } else {
                global 
$_ID;
        }
    
// Display the Intro if we are not in full article view
        
if( !$_ID ) {
            if(!empty(
$introtxt)) {
                echo 
'<div class="intro-Div">';
                    echo 
'<div class="intPad">';
                        echo 
$introtxt;
                    echo 
'</div>';
                echo 
'</div>';
            }
        }
    
//////
    
}
?> 
Style for use with function, can be changed to your needs.
        <style type="text/css">
    .intro-Div{  }
    .intPad{  }
        .intro-Div img { padding:1%; }
        .intro-Div a img {  border:1px solid #f5f5f6; }
        .intro-Div a:hover img {  
            border:1px solid #ccc; 
            background:#f4f4f5;
            }
        .intro-Div p { padding:2px 1%; 
            border-left:12px solid #00FF33; 
            }        
    </style>  


In article editor, use the func button to add content.   add break tag after func tag. 
EG:
Demo:

Note: do not use the chart ( , ) with in the function,
one of snews function cut the text if this chart is used.

08.06.2008. 02:12

moshe on 11.02.2009. 20:24

hey soso,
trim functions will cut text,
but not as flexible as this mod.

soso on 31.01.2009. 22:42

is it just easy to add the full article in category and just cut the the words ?

something like this
$ReplacementArray[$i]["***.description"] = _fnc("strtrim", $RandomezineRow["description"], 350);

strtrim will solve all this in simple way

moshe on 12.07.2008. 16:59

hey vasi :)
i think you have a point, i will go read about akismet.

you are so right, some ppl do not have nothing GOOD to do,
so they messup others.

all i can is feel sorry for them.

funlw65 on 12.07.2008. 14:47

Retarded idiot's are everywhere ...
They destroy everything good and nice. And they can't do anything else, just destroying things.

Well, this is not big deal... the big deal (and very hard) is to make something good. And only THAT is a reason to be proud.

funlw65 on 12.07.2008. 14:41

Moshe, if you allow free comments, maybe is a good idea to use Akismet or something similar...

Write a comment

* = required field

:

:

:


5 + 8 =