Recent Topics

1 Aug 03, 2007 14:29    

My b2evolution Version: 1.9.x

Hi,

using

$Blog->disp('name')


reflects the name of the current blog I´m in... fine... but how do I have to modify this to show the name of the main blog (blog 1) even when I´m currently viewing another blog (blog 2 or 3 or...)?

Does anybody knows a simple solution?

Thank you very much in advance...
Daniel

2 Aug 03, 2007 14:38

In ../blogs/skins/YOURSKIN/_main.php just skip your code and type 'Anything you want' like:

old code:

<h1 id="pageTitle"><a href="<?php $Blog->disp( 'url', 'raw' ) ?>"><?php $Blog->disp( 'name', 'htmlbody' ) ?></a></h1>


new code:

<h1 id="pageTitle"><a href="<?php $Blog->disp( 'url', 'raw' ) ?>">Anything you want</a></h1>

Good luck

3 Aug 03, 2007 14:50

Yeh... that would of course solve the problem... but I´m currently working on a small plugin and I want to have it open for everyone to use... and for this I would need a code and not the name of my blog in plain text...

4 Aug 03, 2007 14:52

<?php
$fred = $BlogCache->get_by_ID( 1 );
$fred->disp( 'name' );
?>

;)

¥

5 Aug 03, 2007 14:57

I am beaten in speed by ¥åßßå, but luckily so, because my answer was different :roll:

6 Aug 03, 2007 15:40

No, that does not work for me; I get error messages... is there another way?

7 Aug 03, 2007 15:41

What's your error message?

If you trying to use this inside a function then you need to global the BlogCache first ;)

<?php
global $BlogCache;
$fred = $BlogCache->get_by_ID( 1 );
$fred->disp( 'name' );
?>

¥

8 Aug 03, 2007 15:43

Uups, my fault, should have told that I intend to use this in a function... and YES, now it´s working properly! THANKS!


Form is loading...