Recent Topics

1 May 25, 2006 21:55    

I've already customized the 'More' to look like how I wanted with the help from someone here.

Now I would like to know if there is a way to use the same function on the sidebar. For example I keep a list of the last fils I saw in the cinema. This list is incredible big now, so wanted to hide it with the 'more' function. Is there a way to do so?

Thanks!

3 May 26, 2006 17:16

Are you using the linkblog to list your films or something else?

¥

4 May 26, 2006 17:55

Sorry, but I don't even know what link blog is... :oops:

I just edit the _main.php template and add the links myself

5 May 26, 2006 18:03

Ok, I just looked the online manual and I think I could be able to try to create a linkblog. Do you know any blog that uses it, so I could have a look first in order to know what exactly I should do?

6 May 26, 2006 18:52

the demo uses the linkblog, but here's how it works :-

you create a new blog (call it Films or summat)

you create categories (and even sub categories) for it

You post your films in your new blog (either as reviews [full post] or as links to a review [urm....link url title or sumat])

you click blogs > [blog name of main blog] and then you select "Films" (in this case) as the linkblog (about 1/2 way down the page)

Then you click save and hope that I've not had to many birthday beers ;)

¥

7 May 27, 2006 02:24

Ok then, I maged to do it as yo u can see here, but I've got some issues http://nando.myacen.com/blog/ (It's on the side bar above the Archives.)

But I couldn't find the place to edit some things, like: To change the tilte putting whatever I want isntead o 'linkblog' and then make it look like exactly like the ohter bside items, like Archives, Misc, etc... I would also to stop showing the subcategory of the linkblog, there is no need in showing it. The "more" button looks weird, it's doesn't look like the same as the one I use for the main blog.

cheers!

8 May 27, 2006 03:02

You look in one of two places to see where the text is and how to give it the right style. First look in skins/yourskin/_main.php and cruise through it until you see something that seems to be about both the linkblog and then the archives. You'll get either this:

<?php // -------------------------- LINKBLOG INCLUDED HERE -----------------------------
	require( dirname(__FILE__).'/_linkblog.php' );
	// -------------------------------- END OF LINKBLOG ---------------------------------- ?>


Or maybe this:

<div class="bSideItem">
	<h3><?php echo T_('Linkblog') ?></h3>
	<?php // -------------------------- LINKBLOG INCLUDED HERE -----------------------------
		require( dirname(__FILE__).'/_linkblog.php' );
		// -------------------------------- END OF LINKBLOG ---------------------------------- ?>
</div>

If you have the second version then you know where to change the "Linkblog" text, but I suspect you have the first. If you find the first version then you need to go a bit further. First though take a look at the code for your archives which you'll find right below the bit for your linkblog. Notice the div class used and if it's an H3 tag and if that tag has a class statement.

Now open skins/yourskin/_linkblog.php and you'll see something like this:

# maximum number of linkblog entries to display:
if(!isset($linkblog_limit)) $linkblog_limit = 20;
# global linkblog delimiters:
if(!isset($linkblog_main_start)) $linkblog_main_start = '<div class="bSideItem"><h3>'.
																														T_('Linkblog').'</h3>';
if(!isset($linkblog_main_end)) $linkblog_main_end = '</div>';
# Category delimiters:
if(!isset($linkblog_catname_before)) $linkblog_catname_before = '<h4>';
if(!isset($linkblog_catname_after)) $linkblog_catname_after = '</h4><ul>';
if(!isset($linkblog_catlist_end)) $linkblog_catlist_end = '</ul>';
# Item delimiters:
if(!isset($linkblog_item_before)) $linkblog_item_before = '<li>';
if(!isset($linkblog_item_after)) $linkblog_item_after = '</li>';

There is more there but that'll be all you'll want to mess with. See where you're getting the "Linkblog" text and where it defines a div class name and an h3 tag? Make the div class name and h3 tag be like your archives from _main.php and make the text be whatever you want it to be.

--------------------

I just looked at your source code. Looks like all you'll need to do is find where the h3 tag and text are and change them to h5 and whatever text you like. That should hook you up.

9 May 27, 2006 17:29

Ok, first step was done. I managed to put the title as I wanted. Thank a lot.

But there are still two steps to complete:

1- I have hundreds of links, so instead of making a post for each link, I posted all links in 1 post and used the 'more' tool. The 'more' tool looks different from the 'more' tool I use for regular posts. Why? Is there any file that needs update?

2- I don't want the links blog to show the 'category' and 'permalinks' , how can I disable it?

Thanks :)

10 May 27, 2006 19:27

The idea with the linkblog is one post per link. There is a param in the linkblog setup (pasted above) that will let you limit the number of linkblog entries shown, but I'm pretty sure they go in alphabetical order. The linkblog also shows the text you've added to your linkblog entries, which is why you see what you see although I don't know why it shows the "more" link differently. I'd have to dig into the code for that and I'm a wee bit busy at the moment.

Back to your questions: Your linkblog (on your main page) is not showing the category the post is in. Only when someone visits the permalink will they see the category. IF you decide to add a second category to your linkblog then the main page will show links in each category and show the category title. In order to not see the category when someone visits the permalink you would have to fiddle with your skin. The easiest way will be to copy your skin and give it a new name, edit the new skin to remove the "Item->categories" bit, then tell your linkblog it uses the new skin.

Removing the permalink from the linkblog displayed on the main page requires a hack, but it's a hack that isn't all that hard to do and can be upgraded very easily. First find skins/_linkblog.php and notice how very similar it is to skins/yourskin/_linkblog.php. Now copy the entire file from skins to skins/yourskin. That's what the commented out part at the end of skins/yourskin/_linkblog.php is talking about:

/**
 * This skin has no special formatting for the linkblog, so...
 * However you can replace this file with the full handler (in /blogs) and customize it!
 * all we want to do here, is call the default linkblog handler.
 */
require get_path('skins').'/_linkblog.php';


It is actually in "skins" - not "blogs"!

Okay so you copy the file to your "yourskin" folder and now have to customize skins/yourskin/_linkblog.php by finding and removing this bit:

?>
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><img src="img/icon_minipost.gif" alt="<?php echo T_('Permalink') ?>" width="12" height="9" class="middle" /></a>
<?php

Hope it helps!

11 May 27, 2006 20:10

EdB wrote:

Back to your questions: Your linkblog (on your main page) is not showing the category the post is in.

Hmmm, if it's not showing, how can I see it? Just below the "Last films..." bside title, you can see the linkblog category called 'links' and then we can see the post itself.

By editing the file you mentioned (skins/yourskin/_linkblog.php), I found this line by accident:

echo $linkblog_item_before;
			$Item->title(); 
			echo ' ';
			$Item->content( 1, 0, T_('more'), '[', ']' );	// Description + more link 
			?>

And I assumed it was the 'more' function I was looking for. And it is. So I edited it.

Now I guess all what I need to edit is in this file (am I right?) I'm just not php expert enough to find out what I need to change, remove or add. If you have the time, please take a look in this file. I now need to remove the category line and that black image that appears when you have items listed.

Thank you, I appreciate your help :)

12 May 27, 2006 21:08

Nando wrote:

Hmmm, if it's not showing, how can I see it? Just below the "Last films..." bside title, you can see the linkblog category called 'links' and then we can see the post itself.

Oh yeah. I guess it is. My bad!

Yes - everything you need to edit to customize the look of your linkblog is in that file. skins/yourskin/_linkblog.php, but do take care to backup your work just in case something goes wrong. I'm pretty sure it's not too hard to get rid of the category name. Something like this I believe will work. Find

	if(!isset($linkblog_catname_before)) $linkblog_catname_before = '<h4>';
	if(!isset($linkblog_catname_after)) $linkblog_catname_after = '</h4><ul>';

and make them be

	if(!isset($linkblog_catname_before)) $linkblog_catname_before = '';
	if(!isset($linkblog_catname_after)) $linkblog_catname_after = '<ul>';


Then further down in the file find and delete

		echo $linkblog_catname_before;
		$Item->main_category();
		echo $linkblog_catname_after;

By the way as you poke around in the code give particular note to the comments. You've probably noticed that function names describe what they're doing. Comments help explain things a bit more, so you end up learning php just by tinkering carefully. Also when you want to make a function do something creative you can follow the link in my signature line then pick the letter the function begins with. After that you have to scroll a bit and think about what you're affecting, but what you'll see is that many functions can be given parameters from inside _main.php to alter how the function works. Just a bit more for you to chew on one day...

13 May 27, 2006 22:00

Hmmm... it's working, thanks. Just the last thing, I prmoise :P

How do I delete the little black dot in the start of the linkblog?

14 May 27, 2006 22:35

Ok, I manged to do it by myself, after deleting almost every line in that file! :P

Thanks for your help, anyway!

Now, I only think about upgrading to the new version (when it's avaliable) and having to remember all the editing I have done to each file... It's better not to upgared at all! :roll:


Form is loading...