Recent Topics

1 Mar 23, 2006 19:06    

hello,
I use full path links for permanent links. The problem is that I would like to use the full path thing for all links, mainly for the "Read More!" link. Is there a way to do it?

Thanks

Lorenzo Ferrara

2 Mar 23, 2006 19:59

I'm not sure I understand what you're looking for because b2evolution already uses full URLs in all internal links including the 'read more' link. It pretty much has to because it uses the base metatag in the head section for skin stuff, meaning it can't take advantage of that for internal links.

And please don't post the same thing twice. I'm going to delete the other copy of this question.

3 Mar 23, 2006 20:43

EdB wrote:

And please don't post the same thing twice. I'm going to delete the other copy of this question.

Sorry for the duplicated post, I'm sure that everyone was able to see that it was an error.

Back to the topic... I have a "Read more!" link like this:
http://www.mysite.com/writings/2006/01/31/p39#more39
and a permanent link like this:
http://www.mysite.net/writings/2006/01/31/this-is-the-post-title

How can I get "Read More!" links like permanent links?

4 Mar 23, 2006 20:46

And... I'm using Phoenix alfa

5 Mar 23, 2006 21:31

Now I understand. I think this was asked for previously, where the "read more" goes to the top of the permalink page instead of going to the permalink+anchor. I haven't tried it, but the area you'll want to play in will be evocore/_item.class.php around line 888. It looks like that is the line that makes the "read more" link, so all you'll have to do is figure out how to make it NOT include the "#more39" part. You won't have EXACTLY the same link because the read more will link by post ID, but I think that too is tweakable in the content function. What you would have is a link that goes to the top of the page instead of the middle of the content.

Oh wait. Did you mean you want to get rid of the post ID portion? In other words use the URL that includes the post title and still goes to the middle of the post? I'm pretty sure you'll hack the same general area to get that done, but (again) I'm not sure exactly what you'd need to do.

It's a start...

6 Mar 23, 2006 21:47

Perfect start!

Tanks!

7 Aug 01, 2006 15:17

Ok, I give up. I'm kind of outraged, because I remember to have made this thing to work in 0.9.x. But now I can't.

First, the reason to do this. When one writes long posts with internal anchors, if the 'Read More' link is of the form 'http://whatever.com/index.php/2006/07/31/p1098#more' and the reader clicks and internal anchor to 'http://whatever.com/index.php/006/07/31/wonderfull_things#conclusions' it will reload the page, although they are the same. Another reason is that I don't know what post 1098 says by memmory when I check my website statistics and realize this has become suddenly into the most popular post of all times. With the full title at least I have a clue.

So, what I did:

Edited in b2evocore/_calss_item.php line 536 within function content. This calls $Item->gen_permalink with the first parameter set to 'urltitle'. This should display the 'Read more' link with the full path and urltitle (not post ID). The effect should be the same as leaving the first parameter ($mode) of gen_permalink() empty if one believes lines 161 and 162.

Inside this case statement (lines 161 to 175) the $urltail variable is set to '$this->urltitle' if and only if '$this->urltitle' is not empty, other wise the '$urltail' is set to 'p . $this->ID', which precisely what I don't want. Therefore I wonder why '$this->urltitle' is empty, because when the permalink is generated ahead (with $Item->permanent_link()), together with the 'Edit', 'Comments', etc. links, it is the full permalink, with the urltitle included, just as I want.

So, I guess I'm missing something really stupid here. Shame on me I don't remember how I solved it before.

Any help wwould be appreciated.

8 Aug 01, 2006 16:00

In main.php (V 1.8 beta)... if you replace

<div class="bText">
	            <?php $Item->content(); ?>
		       <?php link_pages() ?>
			</div>


with...

<div class="bText">
	<?php $Item->content('#','#',$Item->get('title'),'','<p class="center"><strong>Read more</strong><span class="local">&nbsp;&raquo;</span>&nbsp; ','&nbsp;...</p>','htmlbody',10); ?>
	<?php link_pages() ?>
			</div>

you end up with a "Read More" link that looks like the first entry on this page
http://wow-factor.com/index.php?blog=2&cat=1&page=1&paged=8

if that's what your after, as I'm not really sure.

9 Aug 01, 2006 17:35

What version of b2evo are you using? For me (1.8) removing pid from this line of _item.class.php function content() produces the links like you want?

'<a href="'.$this->get_permanent_url( 'pid', $more_file ).'#more'.$this->ID.'">'.

¥

10 Aug 01, 2006 19:55

1.8-beta

The modifications are to be made in 'inc/MODEL/items/_item.class.php' and now it works as desired.

What is this? Some kind of alternative includes stuff. I've missed something in the road from 0.9.x to 1.8

11 Aug 01, 2006 20:16

As long as it works that's cool :D

The whole of the core was (pretty much) rewritten in 1.6 alpha ....... it then got rewritten again [and the file layout/structure] ...... ohhh and most of the function names changed ...... and most of the global vars ......

.... anyway, yer on 1.8 now ;)

¥


Form is loading...