1 tilqicom May 07, 2008 23:55
3 edb May 10, 2008 14:08
Couple of things to think about here. First is "know your disp to control your disp". Groovy yah? So dig it: $disp is the big shot on what gets displayed, so in the file that actually makes your blog page put the following wee bit of code to learn all the different values of $disp:
<?php
if( is_logged_in() ) {
echo '<p>disp is [['.$disp.']]</p>';
} ?>
Then you can do stuff with it using IF statements or switches if you're into switches. To get an initial page to display no posts even though you have posts might be something like this in the appropriate file:
<?php
if( $disp == '' ) {
// in here you put what you want on the first page they see
} else {
// in here goes the normal posts loop
// ...
// be careful to get the entire posts loop
} // close out the if/else thing ?>
I've done lots of groovy stuff with that type of "cheat" though it might not be ( $disp == '' ) that you need for your conditional. It can easily get messy though so have backups handy.
4 tilqicom May 10, 2008 18:51
Hi ed, thank you very much for your answer, this is the only but the biggest issue i have before i get started..
Because, as i have deleted the whole display functions in the posts.main.php, when a search is done, it was searching but not showing the results as all displaying was deleted, as you know search is an integral part of a software site.
I have been dealing with this about a week, i have read [url=http://forums.b2evolution.net/viewtopic.php?p=67251#67251]John's topic[/url] it is similar to what you have said i guess, but your response got me one step closer.
Earlier, I have defined another blog2.main.php and posts3.main.php, and changed the display handler for posts to posts3.main.php for main page in order to still use the same skin but somehow display different(dont know if this is actually necessary)
I guess i will have to open index.main.php and insert those here ?:
<?php
// -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------
skin_include( '$disp$', array(
) );
// Note: you can customize any of the sub templates included here by
// copying the matching php file into your skin directory.
// ------------------------- END OF MAIN CONTENT TEMPLATE ---------------------------
?>
I am not sure where should i put these and how 'exactly' should i use.. I'll try to figure out though..Any further help would be appreciated ..
sorry for bumping the topic,
but let me put this more understandable and easy way;
you know a 'section head' for the current request appears when you search something before the posts are listed..
Let me mention the code which allows this:
And this section shows 'only when you click a category, or when you perform a search' as you know..
Now; as i dont want to lists posts by default, and i want only posts to be listed when a search is performed in the main page (i have mentioned in the above post), the idea is the same basicly..
[u]
Bottomline is :
[/u]
That title is not shown 'until a search is performed or category is clicked'
How can i make my posts
'until a search is performed or category is clicked'[/inot be shown
i believe it has to do sth with an array but dont know how to use it