1 papzadsl Nov 28, 2005 22:04
3 papzadsl Nov 29, 2005 17:05
Uh, I visited that page (u're dutch...lucky man, I've been in Holland on August...kinda Eden, wanna go back :°), but I didn't find anything that could help me in solving my problem.
Could you please help me in that, describing step-by-step what I have to do to get just a single post displayed on every blog' sidebar (I have 9 blogs on the same domain)?
Thank you in advance, lucky dutch man :)
Francesco
P.S.: Haapsalu is different from Venice also 'cause it hasn't bunch of pigeons :)
4 topanga Nov 29, 2005 17:49
For the record : I'm flemish, and live in Belgium.
The netherlands is another country ;)
Your sidebar problem :
you will have to use a different skin for every blog (make copys of the skin)
and put this in the sidebar :
<?php $BlogBList = & new ItemList( 9, $show_statuses, '', $m, $w, '', array(113), $author, $order, $orderby, $posts, '', '', '', '', '', '', '', '1', 'posts', $timestamp_min, $timestamp_max );
// You can restrict to specific categories by listing them in the two params below: '', array()
//9 = blognumber
// '', array(9,15) will restrict to cats 9 and 15 - 2 single quotes
// '9,15', array() will restrict to cats 9,15 and all their subcats
while( $Item = $BlogBList->get_item() )
{ ?>
<a href="<?php $Item->permalink() ?>" title="<?php $Item->content(1,false,'read more','#','#','#','htmlattr'); ?>"><strong><?php $Item->title(); ?></strong>
<?php $Item->content( 1, false, 'read more' ); ?></a>
<?php } ?>
5 papzadsl Nov 29, 2005 22:23
Err...I read "dutch" on that page, so I thought you were from the netherlands. Big mess, I agree. :-/
For my problem: it's quite disappointing to make so many copies (9!) of the same skin; in fact, whenever I would modify something, I should modify 9 different templates :(
Sorry for this bothering, but...is there another way?
Anyway, thanks a lot for you patience and precious counsels!
Francesco
6 balupton Dec 05, 2005 21:15
Why would you need to create a different skin for each?
Is all your trying to do is display all the posts in a certain blog in your sidebar?
Or do you just want to display one post in your sidebar?
7 topanga Dec 05, 2005 21:58
The way I explain, is that you choose a categorie and then show the latest post in that categorie in the sidebar.
On my blog, every blog has its own 'latest post'
On my cooking blog, it is a recepie, on my movie blog it is a filmreview, ...
That's why it's different.
I use 1 skin, but the 'main' page is a noskin page.
I do use all the includes from that skin and the stylesheet.
Dus .. emm.. you're right.
You use 1 skin, but different mainpages
8 balupton Dec 05, 2005 22:15
So with your code here:
<?php $BlogBList = & new ItemList( 9, $show_statuses, '', $m, $w, '', array(113), $author, $order, $orderby, $posts, '', '', '', '', '', '', '', '1', 'posts', $timestamp_min, $timestamp_max );
// You can restrict to specific categories by listing them in the two params below: '', array()
//9 = blognumber
// '', array(9,15) will restrict to cats 9 and 15 - 2 single quotes
// '9,15', array() will restrict to cats 9,15 and all their subcats
while( $Item = $BlogBList->get_item() )
{ ?>
<a href="<?php $Item->permalink() ?>" title="<?php $Item->content(1,false,'read more','#','#','#','htmlattr'); ?>"><strong><?php $Item->title(); ?></strong>
<?php $Item->content( 1, false, 'read more' ); ?></a>
<?php } ?>
The only thing that changes between _main.php files is the 9? Which is referring to the blog id.
9 topanga Dec 05, 2005 22:32
the thing that changes is
'9' = blogid
'113' = categorynumber
10 balupton Dec 05, 2005 23:19
Try this:
<?php
//Start Balupton's Code
$CatID = "";
$BlogID = $Blog->ID;
$CatName = "Site";//The Category Name you Want
$sql = "SELECT *
FROM T_categories
WHERE cat_name = '$CatName'
AND cat_blog_id = '$BlogID';";
$results = $DB->get_results( $sql, ARRAY_A );
/*
echo "<pre>";
print_r($results);
echo "</pre>";
*/
if(sizeof($results) == 0)
echo "error";
else{
$CatID = $results[0]["cat_ID"];
//echo $CatID;
//Start Topanga's Code
$BlogBList = & new ItemList( $BlogID, $show_statuses, '', $m, $w, '', array($CatID), $author, $order, $orderby, $posts, '', '', '', '', '', '', '', '1', 'posts', $timestamp_min, $timestamp_max );
// You can restrict to specific categories by listing them in the two params below: '', array()
//9 = blognumber
// '', array(9,15) will restrict to cats 9 and 15 - 2 single quotes
// '9,15', array() will restrict to cats 9,15 and all their subcats
//echo "<pre>";
//print_r($BlogBList);
//echo "</pre>";
while( $SideBarItem = $BlogBList->get_item() )
{
?>
<a href="<?php $SideBarItem->permalink() ?>" title="<?php $SideBarItem->content(1,false,'read more','#','#','#','htmlattr'); ?>"><strong><?php $SideBarItem->title(); ?></strong>
<?php $SideBarItem->content( 1, false, 'read more' ); ?></a>
<?php
}
}
?>
For me everything works fine except the while loop, it never runs through, even though $BlogBList is filled :S
To prove this put this code above the while loop:
echo sizeof($BlogBList->DataObjectCache->cache).":".$BlogBList->result_num_rows;
[/php]
But other than that it works flawlessy.
11 papzadsl Dec 07, 2005 00:20
Uhm, what I need is to have a single, unique post displayed on my sidebar; and, since I have 9 blogs (one for quotations, one for books, one for movies, one, simply, a blog, etc.) - all with the same skin - I'd like it to be shown on every sidebar. It would be a post displaying my favourite book, movie and song (with a link and an image). I thought it as a post because of its easy modifying. In fact, now I use to manually modify my _main.php by adding manually text and code.
Which code (if there's one suitable for me) match my requests?
Thank you so much guys,
Francesco
12 balupton Dec 07, 2005 02:56
Actually.....
B2evolution supports sideblogs normally.
So couldnt you just make a blog called Favourites,
Post all your favourite things in there, and then set that as the sideblog?
13 topanga Dec 07, 2005 09:20
Francesco,
Your blog is exacly the same as mine.
I have 9 blogs, one with food, one with books, one with movies, one <ith quotes,....
and I have all the same skin,
and ...
You see, I have exacly the same thing.
So why can't you use the solution I'm using allready for years ?
It is the easiest solution possible !
14 papzadsl Dec 07, 2005 09:55
Dear Topanga,
I trust you, but don't trust my skills ;)
What does I exactly have to do? Create as much skin copies as my blogs are (like duplicate dirs "custom1", "custom2", etc.) and set the related into every blog' setting, and then insert the piece of code you kindly gave to me into the _main.php copy I wanto to see this particular post displayed?
Sorry for the mess, but I very need a sort of walkthrough :\
Really, really thank you
Francesco
15 topanga Dec 07, 2005 12:35
Like I explaind (not efficiently) a couple of post above :
You need 1 skin
and 9 no-skin pages, who do use the skin-includes and skin css.
Start with 'a_noskin.php'
If you use a skin now, you mostly copy all of _main.php into that file.
Just have a look.
I can't code either, but I can compare stuff with each other.
It is the layout actual code that you need to copy.
Have you changed the skin you want to use, or is it a default skin.
16 papzadsl Dec 07, 2005 12:43
I've quite modified the LEAF skin I use.
Still a bit confused, I'm trying to explain what I think: I create a file called a_noskin.php that's the copy of _main.php.
Then I have to set it in each blog as a STUB file?
I'm confused. If you don't want to waste your time anymore, just give up. I'll understand!
Francesco
17 pyogazel Aug 13, 2006 02:48
balupton wrote:
So with your code here:
<?php $BlogBList = & new ItemList( 9, $show_statuses, '', $m, $w, '', array(113), $author, $order, $orderby, $posts, '', '', '', '', '', '', '', '1', 'posts', $timestamp_min, $timestamp_max ); // You can restrict to specific categories by listing them in the two params below: '', array() //9 = blognumber // '', array(9,15) will restrict to cats 9 and 15 - 2 single quotes // '9,15', array() will restrict to cats 9,15 and all their subcats while( $Item = $BlogBList->get_item() ) { ?> <a href="<?php $Item->permalink() ?>" title="<?php $Item->content(1,false,'read more','#','#','#','htmlattr'); ?>"><strong><?php $Item->title(); ?></strong> <?php $Item->content( 1, false, 'read more' ); ?></a> <?php } ?>
The only thing that changes between _main.php files is the 9? Which is referring to the blog id.
I tried this and it woks, it does actually show a post from a blog, but it seems to show the last entry from this blog.
Is there a way to show a specific post (a specific entry of the blog)
There are 3 or 4 entries of my blog 2 that I would like to show in the sidebar, I have their ID (231, 232, 233, 234) but I don't know how to say "I want this post to be displayed all the time here"
Help anyone?
18 pyogazel Aug 25, 2006 14:34
humm
looks like nobody knows how to do that :D
Ok, I'll just use a link blog... or two :lol:
19 topanga Aug 25, 2006 15:10
another method would be to put them in a different categorie and show all the posts in that categorie...
instead of showing only one, you show (in your example) 4 posts...
20 pyogazel Aug 29, 2006 00:32
Thank you for your answer topanga, I actually don't know yet how to show all posts of a specific category, howerver, I have now mastered the multiblog option (no kidding!) and am fully satisfied with the result !!!
[url=http://pyogazel.free.fr/index.php?blog=2&skin=coeurs]If you read french[/url], they are (blog B to H2) under the sidebar title "trucs de Fille":
from "fait" to "mes patrons gratuits" [url=http://pyogazel.free.fr/index.php?blog=10&skin=crocheted0] if you don't [/url] they are (blog B to E) under the sidebar title "wips and stuff".
from "work in progress" to "reading"
I'm so glad i sticked to it, I was started to feel discouraged but in the end it wasn't that difficult!
I luv b2 !
Well, I'm using that kind of thing allready for more than 2 years.
I think what you need is the thing you'll see in multiblogs.php
http://www.tenderfeelings.be/blog/english.php