Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Short Story Issues
1 2
William
Posted on 06 Jul 2010, 02:31:52

Access: Member
Total Posts: 38
Joined: 2010-02-12

Chris = FTW!

You kick tail! :lol:
#2625
William
Posted on 06 Jul 2010, 03:04:39

Access: Member
Total Posts: 38
Joined: 2010-02-12

Crap! wait, thats fixed, BUT, I want to be able to display that as is on the homepage...then on the blog page display the full blog, minus the {summary}.

I tried taking out the {summary} tag but that just completely removed the blog.

William = NOOB
#2626
Chris
Posted on 06 Jul 2010, 03:08:38

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Create a copy of the "home" template, call it "fullarticle" or something.

Edit the "fullarticle" template and remove the {summary} tag leaving only the {article} tag.


Use the following code for your include

Code:
<?php
if(!$_GET['id']){
   
// not viewing a single article, use the normal template
   
$template = 'home';
}else{
   
// viewing a single article, use the fullarticle template
   
$template = 'fullarticle';
}

$cat[] = 'blog';
include 
'news/index.php';
?>
#2627
William
Posted on 06 Jul 2010, 03:15:45

Access: Member
Total Posts: 38
Joined: 2010-02-12

Crap, still no worky.

Here is what i put for the include on the blog page...
Code:
<?php
                
if(!$_GET['id']){
                   
// not viewing a single article, use the normal template
                   
$template = 'home';
                    }else{
                       
// viewing a single article, use the fullarticle template
                       
$template = 'blog';
                    }

                
$cat[] = 'blog';
                include 
'news/index.php';
            
?>

#2628
Last edited by William at 2010-07-06 03:17:02 Reason:
Chris
Posted on 06 Jul 2010, 03:56:15

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

This time I'm definitely blaming you! Have a look at some of the articles that are being displayed on blog.php, if you edit one via the admin area you might notice something..

They have the same text in both the summary section and the article section.

Example if you look at this one you'll see what I mean

http://virginiarivers.me/news/admin.php?action=editnews&id=41
#2629
William
Posted on 06 Jul 2010, 04:03:32

Access: Member
Total Posts: 38
Joined: 2010-02-12

Yes, this is true, but still that doesnt change the fact that its only displaying what I put in the summary. I still have to click the "read more" to see it all. Im so confused. Darn you coders.
#2630
Chris
Posted on 06 Jul 2010, 04:05:42

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Edit:

I've added a new test article into the system and assigned it to the blog category so it shows on blog.php,

http://virginiarivers.me/blog.php
#2631
Last edited by Chris at 2010-07-06 04:20:59 Reason:
William
Posted on 06 Jul 2010, 05:13:09

Access: Member
Total Posts: 38
Joined: 2010-02-12

I see that. Its still displaying the summary version. Thats the thing, I probably explained it wrong...Heres the functionality im going for...(ready to murder me yet? lol)

HOMEPAGE - displays the summary (unless clicked read more)
BLOG PAGE - displays ONLY the full story (or article). NOT the summary.

I hope that helps. Please dont be mad. :-)
#2632
Chris
Posted on 06 Jul 2010, 15:29:43

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

I've made some changes to the script that'll be released in version 4.0 but you can download a few files and use it now.

Basically 2 new variables have been added to the script that you can specify before the include code. These variables let you decide if the summary and/or article get displayed. So you won't have to do any of this fancy custom code business.

Download a copy of index.php and functions.php from here

http://n-13news.googlecode.com/svn-history/r194/branches/40/functions.php

and here

http://n-13news.googlecode.com/svn-history/r194/branches/40/index.php

Replace your own copies with these new ones. Now here are the 2 variables you specify before the include.

Code:
<?php
$news_layout 
= '0';
// How the articles are shown when not viewing a single post
// 0 = default, shows article, if post has a summary shows it instead
// 1 = Show summary only
// 2 = Show article only
// 3 = Show summary and article

$comments_layout = '0';
// How the articles are shown when viewing a single post
// 0 = Show both article and summary
// 1 = Show summary only
// 2 = Show article only

include 'news/index.php';
?>


So say for example you want to display the summary, then once readmore is clicked show both the summary and article you could do this (home.php)

Code:
<?php
$news_layout 
= '1'; // show only summary
$comments_layout = '0'; // show both article and summary when viewing readmore

include 'news/index.php';
?>


Say you wanted to display the article only and not the summary (blog.php) you would do this

Code:
<?php
$news_layout 
= '2';
$comments_layout = '2';

include 
'news/index.php';
?>
#2634
William
Posted on 06 Jul 2010, 16:13:12

Access: Member
Total Posts: 38
Joined: 2010-02-12

Thats brilliant Chris. Thats all I can say. BRILLIANT! (sorry, I would do the marquee thing but I dont know how, only your smart enough to do that lol)
#2635
1 2
Network-13.com © 2013