1 disckreto Dec 07, 2005 12:27
3 disckreto Dec 07, 2005 21:24
yes, exactly
I want to display all the categories in the sidebar for each blog but only in that blog
and, by the way, ito de main blog I want to display all the post of any blog, but not the categories of those others blogs.
That´s my problem.
thanks
4 personman Dec 07, 2005 21:34
You could fix it this way. Open the _main.php file for the custom skin and find this:
<?php // -------------------------- CATEGORIES INCLUDED HERE -----------------------------
require( dirname(__FILE__).'/_categories.php' );
// -------------------------------- END OF CATEGORIES ---------------------------------- ?>
and change it to this:
<?php // -------------------------- CATEGORIES INCLUDED HERE -----------------------------
if ($blog != 1 ) {
require( dirname(__FILE__).'/_categories.php' );
}
// -------------------------------- END OF CATEGORIES ---------------------------------- ?>
5 disckreto Dec 07, 2005 22:27
thanks a lot personman,
I did it, it runs ... but not in the way we wanted
I mean
if you check out http://www.urblog.org/
in the main blog (named like urblog), in the sidebar it displays yet all the categories ... not only those of "urblog"
but in the others blogs
like "imagenes" it's ok, right now it only displays their own categories
that´s what we wanted to do also with the main blog ... "urblog"
¿ why ?
because each blog will have and manage more or less 50 differents categories ... and it will be too much x 4
¿ any other idea ?
will be superwellcome
thankyou
6 disckreto Dec 08, 2005 12:07
Dear personman,
I've tried this code into the evol main.php.
what happens is that it do not display the categories into the sidebar, no one,
but I want to display the categories from that blog-1 into blog-1
althoght it displays the categories in the rest of blogs, only their categories (that´s right, ok)
7 personman Dec 08, 2005 15:19
Ok, this is possible, but it won't be easy. Here are the steps.
1. Copy the _categories.php file from /skins/ to /skins/helsinki, replacing the smaller _categories.php file in the helsinki folder.
2. Open up the new _categories.php file in the helsinki folder.
3. Find a line that looks like this:
{ # by uncommenting the following lines you can hide some blogs
// if( $curr_blog_ID == 2 ) continue; // Hide blog 2...
and uncomment that second line, duplicating it for blogs 2-4:
{ # by uncommenting the following lines you can hide some blogs
if( $curr_blog_ID == 2 ) continue; // Hide blog 2...
if( $curr_blog_ID == 3 ) continue; // Hide blog 3...
if( $curr_blog_ID == 4 ) continue; // Hide blog 4...
4. At this point it will not display categories from blogs 2-4 in the sidebar, but it will happen on any blog that uses the helsinki skin. That's not what you want, and there are a couple of ways to fix it.
a. Make a copy of the entire skin (copy the folder and rename one of them to helsinki-all or something). Then make the change above to one of the skins and set it as the skin on blog 1. Leave the other one as it was. This way will definately work, but any layout changes will have to be made to both skins from now on.
b. An easier way would be to make two copies of the _categories.php file, one called _categories-all.php, in which you make the above changes, and the other leave it as the stock file. Then in your skin have a statement like this:
<?php // -------------------------- CATEGORIES INCLUDED HERE -----------------------------
if ($blog != 1 ) {
require( dirname(__FILE__).'/_categories.php' );
} else {
require( dirname(__FILE__).'/_categories-all.php' );
// -------------------------------- END OF CATEGORIES ---------------------------------- ?>
c. It might also be possible to do it all with one file, putting the if condition that checks to see if you're on blog one into the _categories.php file. I haven't tested that, so I'm not sure if it works.
I would reccomend 4b.
8 disckreto Dec 09, 2005 10:18
ok, I will try it ...
I will tell you about.
-----
I have an other question we have find also in others blogs we have :
http://forums.b2evolution.net/viewtopic.php?p=30047
9 disckreto Dec 10, 2005 02:20
Hi
we found a really pretty stuff in order to get a solution,
it´s a kind of extensible menu for the categories that just runs in the main-blog ...
http://urblog.org
that allows any user to display or hide the categories.
really fine !!
but right now we´re looking the way to display the name of the blog besides the name of the category into the post ...
it seems very simple, but we don´t find it ...
I mean, in main.php there's an order who calls and links the categorie of each post ...
<?php
echo ', ', T_('Categories'), ': ';
$Item->categories();
?>
We have tried to do the same to call and link the name of the blog of the post but it doesn´t runs ...
It accepts until here :
<?php
echo ', ', T_('Blog'), ': ';
$Item->blogs();
?>
but we're not able to name-call the blog
$Item->blogs(); do not works, we've tried with a lot of possibilities but nothing works
do you now wich order may works ?
or well how to name the blog who contents the post ?
10 blueyed Dec 10, 2005 04:21
Try:
$cat_Blog = & $BlogCache->get_by_ID( cat_blog( $Item->main_cat_ID ) );
$cat_Blog->name();
11 disckreto Dec 10, 2005 10:36
I guess you say :
<?php
echo ', ', T_('Blog'), ': ';
$cat_Blog = & $BlogCache->get_by_ID( cat_blog( $Item->main_cat_ID ) );
$cat_Blog->name();
?>
or not ?
cause it doesn´t work ... it doesnot accept: name()
thanks
12 blueyed Dec 10, 2005 18:42
Use $cat_Blog->disp( 'name' ) or $cat_Blog->disp( 'shortname' ) then.
13 rebuscador Dec 10, 2005 22:29
hi, i get a
Fatal error: Call to undefined function: cat_blog() in /home/urblog/public_html/skins/custom/_main.php on line 105
usin' any of the codes...
thanks in advance
14 blueyed Dec 11, 2005 01:00
Sorry, the function should be "get_catblog()" - as said I've not tested it.
So, probably this should work (you could use "name" instead of "shortname" in the last line).
<?php
echo ', ', T_('Blog'), ': ';
$cat_Blog = & $BlogCache->get_by_ID( get_catblog( $Item->main_cat_ID ) );
$cat_Blog->disp( 'shortname' );
?>
15 rebuscador Dec 11, 2005 02:32
yep, it works perfect now. thank you so much.
16 blueyed Dec 11, 2005 14:06
disckreto wanted to know how I've done it on my own blog at http://hahler.de/all, because it gets used only for the "all" blog.
So, here's the code I use there (which may only work with Phoenix):
if( $Blog->ID == 1 )
{
$ItemsBlog = & $Item->getBlog();
echo ', <a href="'.$ItemsBlog->dget( 'blogurl', 'raw' ).'">';
$Item->blog_name();
echo '</a>';
}
The point being is just to see if the current Blog is ID 1.
17 disckreto Dec 12, 2005 10:02
uummm .. thanks blueyed, but we don´t run in phoenix.
For the instance the other code you gave us works perfectly, enough ... but the name of the blog is just displayed, not also linked, if we find the way to made it a link, ok, if not it will stay only named.
So, you don't want blog 1 to show the categories from the other blogs in the sidebar, but you do want it to show the posts from the other blog in the main area?