This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Main page as intro, not news page


avatar
MarkB 0
From: -
Main page as intro, not news page

Hi,

I would like to use the main page of Storyteller as a default intro page, with no news items listed (these will be accessed under a 'story' menu).

How do I do this? What template or file do I need to edit?

I just want

$headerblock

allmystuffinHTML

$footerblock

It will still need to be PHP since I want to bring in a random entry Smiling Face

Thanks!
Mark

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Main page as intro, not news page
avatar
OP 0
From: -
Main page as intro, not news page

Wow, thankyou! Smiling Face I think I'm getting my head around the code/template structure now...

Thanks again!
1 Re: Main page as intro, not news page
avatar
Administrator
1340
From: Vienna, Austria
Main page as intro, not news page

Remove the following from your main_page template:

<table width="180" border="0" align="right" cellpadding="0" cellspacing="10"><tr>

<td width="233" bgcolor="#000000"> <div align="center"><img src="https://www.contentteller.com/random.gif" width="180" height="41"></div></td></tr>
<tr><td bgcolor="#181818">
<p align="justify"><font color="#CCCCCC" size="1" face="Verdana, Arial, Helvetica, sans-serif">

.....

<a href="https://www.contentteller.com/..">Continued...</a></strong></font></p>


and put it into a new template (here in this example: flame_random.tmp.php - just upload the new file to your templates directory):

<?php

global $insert;

$EST_TEMPLATE = <<<TEMPLATE

<!-- Template flame_random -->

<table width="180" border="0" align="right" cellpadding="0" cellspacing="10"><tr><td width="233" bgcolor="#000000"> <div align="center"><img src="https://www.contentteller.com/random.gif" width="180" height="41"></div></td></tr>
<tr><td bgcolor="#181818"><p align="justify"><font color="#CCCCCC" size="1" face="Verdana, Arial, Helvetica, sans-serif">$insert[story_text]</font></p></td></tr></table>

TEMPLATE;
?>


Now change the following in index.php

Find:
                $mainnews .= GetTemplate("news");

}
$mainnews .= GetTemplate("news_featuredfooter");
}


and replace it with:
                $mainnews .= GetTemplate("flame_random");

}
$mainnews .= GetTemplate("news_featuredfooter");
}


Then move the entire main page code:
        if ($blocks[website_textenabled])

{
$insert = $blocks;
.......
$mainnews .= GetTemplate("main_page");
}

below the featured (now random) story routine.
1 Re: Main page as intro, not news page
avatar
OP 0
From: -
Main page as intro, not news page

That's great - thankyou again! Smiling Face

Where do I change where on the page the featured/random story bit comes up? At the moment it is showing at the bottom of the page, but I'd like it to be on the side (as demoed)...

Thanks!
Mark
1 Re: Main page as intro, not news page
avatar
Administrator
1340
From: Vienna, Austria
Main page as intro, not news page

Here the random story mod. In index.php find:
$result = DBQuery("SELECT * FROM esselbach_st_stories WHERE story_main = '1' AND story_sticky = '1' AND story_hook = '0' ORDER BY story_id DESC");


and replace with:
        // Random story mod

$result = DBQuery("SELECT story_id FROM esselbach_st_stories");
while (list($story_id) = mysql_fetch_row($result)) { $stories[] = $story_id; }
$randstory = rand(0, count($stories));

$result = DBQuery("SELECT * FROM esselbach_st_stories WHERE story_id = '$stories[$randstory]' and story_hook = '0'");


This will turn the 'featured stories' feature into a 'random story' feature

Find:
WriteCache("news", "mainnews", $mainnews, 0);

and replace with:
WriteCache("news", "mainnews", $mainnews, MkTime()+600);


The intro page will now refresh every 10 minutes (600 seconds)
1 Re: Main page as intro, not news page
avatar
OP 0
From: -
Main page as intro, not news page

Ok, got it sorted. Next time I'll actually open my eyes! Winking Face

Thankyou! Great script! Smiling Face
1 Re: Main page as intro, not news page
avatar
OP 0
From: -
Main page as intro, not news page

Hi Philipp - thanks. Unfortunately, a news bit still shows:

 www.flameyourboss.com/index.php (at the bottom).

Any ideas?
1 Re: Main page as intro, not news page
avatar
Administrator
1340
From: Vienna, Austria
Main page as intro, not news page

Hi Mark,

No need to change the templates for that Smiling Face

Just select "Show this news on main site?" => "No" and the news item will be not displayed on the intro page.

If you like to hardcode this settings, open mod_news.php and replace:
MkSelect ("$words[SNM]", "mainnewsonly", "1");

with
MkSelect ("$words[SNM]", "mainnewsonly", "0");


You can use the annoncement feature (Other/Website => Annoncement) for your HTML code.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.