Recent Topics

1 Aug 03, 2007 09:48    

My b2evolution Version: 1.9.x

Hi, using b2evo 1.9.2 I turned on my trackbacks today because I read, that this might be usefull... (I had it turned off, because I wanted to prevent as much spam as possible, but ok, I´ll give it a try...).

Looking at a post, there are now two more lines incl. the trackback URL... but, it is not displayed completely due to the given font face and size.

With which CSS-code I can customize this so that the complete URL will be shown? I want another font face with a smaller font size...

And... is it possible as well to change the view of the "Trackback (0)" below each posting? I would like to to customize this as well, similar to my views-information:

<?php $Item->views( '', ' &bull; one view', ' &bull; %d views'); ?>

Is it possible to do it the same way for trackbacks? I can´t test it at the moment - and that´s why I´m asking this question - because so far I don´t have a single trackback...

Thank you very much for your answers in advance...
Daniel

3 Aug 03, 2007 13:36

First post:
Do you have a link to a post with a pingback where the link is too long;

Second post: The trackback has been rejected by the receiving site, it looks as if it is send properly. Have you got a friend with a blog to experiment the trackbacks?

Do read [url=http://forums.b2evolution.net/viewtopic.php?t=12041&start=0&postdays=0&postorder=asc&highlight=][Plugin] Antispam DNS trackback. The end solution[/url] if you're into trackback business.

Good luck

4 Aug 03, 2007 15:59

[u]First problem:[/u]
Do I understand you correctly, that you want to see an example on my blog? Sadly no problem, go to any of my postings, e.g. the last one: http://www.chaoszone.de/blog/webnews.php/2007/08/03/multi_monitors and have a look through [u]Firefox[/u]... IE6 shows the trackback correctly with a line break so the first line is http://www.chaoszone.de/blog/htsrvs/trackback.php/512? and the second one wlkey_18=YE1kKrSEaqukKa7vJOucTh1fjtSoaQd2. In Firefox I only see http://www.chaoszone.de/blog/htsrvs/trackback.php/512?wlkey_18=0hW and not the whole thing which continues with dKvXKV7BnHPRHGbWmiFAXmwvXPBIl... Hey, why are both trackbacks not the same??? Hm, only another thing I don´t understand right now... but the main problem is... why does Firefox 2.0 makes no line break so everyone could see till the end of the trackback URL?

[u]Second problem:[/u]
Ah... no I sadly know no one personally with a blog with whom I can try some stuff... and yes, I certainly will read your proposed article...

5 Aug 03, 2007 16:08

Where do you want me to look? I only see:

Bisher keine Kommentare/Trackbacks/Pingbacks für diesen Eintrag...

Your screen is wide enough for the trackback links :>

6 Aug 03, 2007 17:03

Ah.. yes, my page in in german... ok... right above "Kommentare, Trackbacks, Pingbacks:" you can see the headline "Trackback Adresse für diesen Eintrag:" that means "Trackback Adress for the posting:", type in the captcha below this, hit "Zeige Trackback..." and voila you see the trackback URL... fine in IE6 but cut in Firefox!

7 Aug 03, 2007 17:11

There isn't a possibility to cut the URL, unless you treat it with some PHP or even javaScript. I doubt if it will copy/paste if you insert a "/n".

Are you satisfied with this css solution?:

code 
{
overflow: auto
}

Good luck

8 Aug 03, 2007 17:16

completely untested ..... mainly because I'd need to enable trackbacks to see if this works :P, but change your skins _feedback.php to look like this ..... you never know, it might work ;)

<code><?php
	ob_start();
	$Item->trackback_rdf(); // trackback autodiscovery information
	$all = ob_end_clean();
	echo preg_replace( '#(<a[^>]+?>.{0,30}).*?(</a>)#', '$1$2', $all );
?></code>

¥

9 Aug 03, 2007 17:38

Now I´m a little bit lost...

@Afwas, do you know the correct css-code, where I have to integrate the "overflow: auto"? It can´t be "code", right?

@¥åßßå, I´m not a big coder and I try to understand what I do with my stuff... but I do not understand, what your code should do... What exactly is is, what these lines should do?

10 Aug 03, 2007 17:49

Daniel wrote:

@Afwas, do you know the correct css-code, where I have to integrate the "overflow: auto"? It can´t be "code", right?

As you see in ¥åßßå's code, it generates a <code> tag. That's where you want to act your css upon (is this English?)
You could and perhaps should edit ¥åßßå's code to

<code class="trackBack">


and the css to:

code.trackBack{
...


you can change the fontsize also in css:

code.trackBack {
font-size: xx-small;
}


as you suggested in an earlier post. small or x-small or 8px or 6px or so might work also.

You place the css in the stylesheet of your skin (other possibities exist).

Good luck

11 Aug 03, 2007 18:32

Hmmm, ok... in general it´s working with

code
{
	font-family: Helvetica;
	font-size: 9px;
	overflow: auto;
}

in my custon.css - it´s small, but it should be readable respectively everyone should now be able to copy and paste this trackback URL; "overflow: auto" shall work with Firefox2, but whith mine it does not... it only works in my IE6 - weird!

But some things are still unclear...

1) Why does the trackback URL have random-stuff behind the "...trackback.php/512", for what is this necessary and if it´s not really necessary, how can I get rid of it?

2) And one remaining thing from my first posting; how can I modify the "Trackback (0)" below each posting, so that it would look like this: "0 Trackbacks", "1 Trackback", "2 Trackbacks", ...?

12 Aug 03, 2007 19:03

Daniel wrote:

2) And one remaining thing from my first posting; how can I modify the "Trackback (0)" below each posting, so that it would look like this: "0 Trackbacks", "1 Trackback", "2 Trackbacks", ...?

Open ../blogs/inc/MODEL/items/_item.class.php and look on line 1621 (B2evo version 1.10.2):

				if( $hideifnone === '#' ) $hideifnone = false;
				if( $title == '#' ) $title = T_('Display trackbacks / Get trackback address for this post');
				if( $zero == '#' ) $zero = T_('Trackback (0)');
				if( $one == '#' ) $one = T_('Trackback (1)');
				if( $more == '#' ) $more = T_('Trackbacks (%d)');


and change 'Trackback (0)' to '0 Trackbacks' etc. The last one becomes: '%d Trackbacks'.

Good luck

13 Aug 03, 2007 19:24

Ah... thanks... but it´s easier: http://doc.b2evolution.net/v-1-9/evocore/Item.html#methodfeedback_link

I now have changed

<?php $Item->feedback_link( 'trackbacks', ' &bull; ' ) // Link to trackbacks ?>

in my _main.php into

<?php $Item->feedback_link( 'trackbacks', ' &bull; ', '', '0 Trackbacks', '1 Trackback', '%d Trackbacks' ) // Link to trackbacks ?>

Great... one problem solved... one remains:

Why does the trackback URL have random-stuff behind the "...trackback.php/512", for what is this necessary and if it´s not really necessary, how can I get rid of it?

14 Aug 03, 2007 20:06

Your solution is definitely preferred.

15 Aug 04, 2007 11:18

Daniel wrote:

Great... one problem solved... one remains:

Why does the trackback URL have random-stuff behind the "...trackback.php/512", for what is this necessary and if it´s not really necessary, how can I get rid of it?

Ok, I'll jump in. The Captcha plugin, which you have enabled to prevent automated trackback spam, generates a code. That's the "random stuff". If I want to send you a trackback, I have first to input the captcha code, read the URL for the trackback and then use it from my blog. An automated script suposedly could not do the first thing (input the captcha code). If the "random-stuf" were not random, a spammer would simply input the captcha code once and then use it always in his automated spam script.

I think that's pretty much it. Hope I explained myself.

Auf Wiedersehen!

16 Aug 04, 2007 22:06

That´s explanation enough, thank you... I thought so too but I was not sure...

In general the long random URL is not the problem... but as I have seen on at least one other b2evo blog (in Firefox), the Trackback-URL+random-captcha-stuff is cut and not shown completely... I think I have to find a better soltion but to use smaller fonts... so I´m open again for any ssuggestions about that...

17 Aug 04, 2007 22:50

Did you have a look at ¥åßßå's solution?

18 Aug 04, 2007 23:04

@Afwas, no... not really (shame on my... I know... sorry!) - simply because I was not really sure, where resprectively instead of what I should try to implement this...

		<div class="bSmallPrint>
			<?php $Item->permanent_link('<img src="'.$rsc_url.'icons/chain_link.gif" />', '#', 'permalink_right'); ?>
			<?php $Item->feedback_link( 'comments', '' ) // Link to comments ?>
			<?php $Item->feedback_link( 'trackbacks', ' &bull; ', '', '0 Trackbacks', '1 Trackback', '%d Trackbacks' ) // Link to trackbacks ?>
			<?php $Item->views( '', ' &bull; eine Ansicht', ' &bull; %d Ansichten'); ?>
			<?php $Item->edit_link( ' &bull; ' ) // Link to backoffice for editing ?>
			<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
		</div>

Is it correct, that I simply should replace

<?php $Item->trackback_rdf() // trackback autodiscovery information ?>

by ¥åßßå's code:

<code><?php
    ob_start();
    $Item->trackback_rdf(); // trackback autodiscovery information
    $all = ob_end_clean();
    echo preg_replace( '#(<a[^>]+?>.{0,30}).*?(</a>)#', '$1$2', $all );
?></code> 

19 Aug 04, 2007 23:07

No, you should find the <code> thing and replace there. Possibly it's in _trackback.php, but I feel lazy at the moment. :lol:

20 Aug 05, 2007 08:36

No didn´t get it... perhaps my night was not long enough... but I can´t find the file (and position) where to implement ¥åßßå's code...

21 Aug 05, 2007 08:45

Ok, in your skins _feedback.php fincd a section of code that look like this :-

		<code><?php $Item->trackback_url() ?></code>

And change it to look like this :

		<code>
		<?php
		ob_start();
		$Item->trackback_url();
		$fred = ob_get_clean();
		echo implode( '?<br />',explode( '?', $fred ) );
		 ?>
		</code>

And your trackback url should be split as you want ;)

¥

22 Aug 05, 2007 09:04

Thanks ¥åßßå for the exact position... but sadly it doesn´t solve my problem in Firefox... and I don´t know why...

My code now looks like this:

	<?php
	/*
	 * Trigger plugin event, which could display a captcha form, before generating a whitelisted URL:
	 */
	if( ! $Plugins->trigger_event_first_true( 'DisplayTrackbackAddr', array('Item' => & $Item, 'template' => '<code>%url%</code>') ) )
	{ // No plugin displayed a payload, so we just display the default:
		?>
		<code>
		   <?php
		   ob_start();
		   $Item->trackback_url();
		   $fred = ob_get_clean();
		   echo implode( '?<br />',explode( '?', $fred ) );
		   ?>
		</code> 

Do I have to modify something at the <code>%url%</code> as well? because the long trackbakc-URL comes because I use captcha... this I have learned so far...

23 Aug 05, 2007 09:11

I forgot about your captcha thing :P

Try it this way instead :-

 	<?php
	/*
	 * Trigger plugin event, which could display a captcha form, before generating a whitelisted URL:
	 */
	ob_start();
	if( ! $Plugins->trigger_event_first_true( 'DisplayTrackbackAddr', array('Item' => & $Item, 'template' => '<code>%url%</code>') ) )
	{ // No plugin displayed a payload, so we just display the default:
		?>
		<code><?php $Item->trackback_url() ?></code>
		<?php
	}
           $fred = ob_get_clean();
           echo implode( '?<br />',explode( '?', $fred ) );

¥

24 Aug 05, 2007 09:29

Ok, this works now properly! GREAT!

But...ah... now everybody can successful copy the complete URL, but when he will paste it anywhere else, the URL has still two lines... with the <br> in between... so the person has to make from these two lines one again... possible but I don´t know if it will be done without a hint on my page which would possibly not be read...

AND, what makes it worse... the captcha doesn´t work anymore for the trackbacks... At first I was happy because (logged in) I saw 2 lines for the long URL but then I logged out and couldn´t type in the captcha because the picture won´t work...

Two new problems... >:-<

25 Aug 05, 2007 09:38

Ok, lets try something a tad different, change the echo statement to look like this and see if it fixes the captcha :

echo preg_replace( '#(<code>.+?\?)(.+?</code>)#', '$1'."\n".'$2', $fred );

¥

26 Aug 05, 2007 09:57

Yep, this works now for IE6 and FF2 with and without captcha, and when I copy and paste the URL now, I don´t habe a line break but a space between the ? and the following captcha-stuff...
The solution is good, but for users who don´t read hints how to copy and paste this URL the space will destroy IMO the URL by pasting it in the other blog, or not?

27 Aug 05, 2007 10:04

ok, we're getting closer ;)

Try this and see if things go bang ;)

echo preg_replace( '#(<code>.+?\?)(.+?</code>)#', '$1<span></span>$2', $fred ); 

¥

28 Aug 05, 2007 10:21

Nope... works great in IE, because line break and no space in between but in FF the line now breaks not anymore...

29 Aug 05, 2007 10:27

:P

Last try :

echo preg_replace( '#<code>(.+?\?)(.+?)</code>#', '$1<span></span>$2', $fred ); 

¥

30 Aug 05, 2007 12:41

Na sadly that works not either in FIrefox - no line break...

31 Aug 05, 2007 13:04

Ok, I think I´ve found it...

echo preg_replace( '#<code>(.+?\?)(.+?)</code>#', '$1<wbr>$2', $fred ); 

Uses <wbr> which is acc. to what I´ve found out not a "good" html standard, but it suits my needs... and so I will use it... :lol:

PROBLEM SOLVED!

32 Aug 05, 2007 13:23

In that case, try this and see if it works

echo preg_replace( '#<code>(.+?\?)(.)(.+?)</code>#', '$1<span>$2</span>$3', $fred );

¥

33 Aug 05, 2007 14:15

No, my line with the <wbr> works, your last sadly not...

34 Aug 05, 2007 14:18

How bizzare, I hate when shit wins, fancy another try? ;)

echo preg_replace( '#<code>(.+?\?)(.+?)</code>#', '$1<span style="clear:both"></span>$2', $fred );

¥

35 Aug 05, 2007 14:23

No... tried this as well... <wbr> still wins!

36 Aug 05, 2007 14:31

bugger, I'm gonna have to enable trackbacks and have a play now ..... no way a bloody browser's gonna win :P

¥

37 Aug 05, 2007 14:36

Hehe, :lol: but think of it that this weird non-line brekas are only occuring in Firefox not in IE6...

38 Aug 05, 2007 14:41

echo preg_replace( '#<code>(.+?\?)(.+?)</code>#', '$1<span style="display:block;">$2</span>', $fred );

G'won, you know you want to validate ;)

¥

39 Aug 05, 2007 14:52

Hehe... this works now great with FF, but after I tried with IE as well, I have two lines I paste into my test text file... still... <wbr> works in both browsers fine...

40 Aug 05, 2007 14:56

ack, it's not often I feel like shooting firefox ..... ahh well, it'll make a nice scarf I suppose :p

¥

41 Aug 07, 2007 02:48

Let me have a go at it:

echo preg_replace( '#<code>(.+?\?)(.+?)</code>#', '$1​$2', $fred );

I found [url=http://www.cs.tut.fi/~jkorpela/html/nobr.html#wbr]this article[/url] on the topic. It suggests it's not really a FF failure, but the HTML specifications dropped <wbr> without replacing it. Well, it is a failure: <wbr> shouldn't work in FF.

You might want to incapsulate the code like: if useragent = FF -> code because IE tends to display boxes if it doesn't have the character in it's font. The character is a zero width space.

Good luck

42 Aug 07, 2007 07:17

Hi,

according to http://de.selfhtml.org/html/text/zeilenumbruch.htm#erlauben (sorry it´s in German), I would have 3 options to enforce a line break:

&shy;

or

<wbr>

or


But as you can see in the list on the linked page (even when it´s in German... "fehlerhaft" means "faulty") ​ would be working good ("kein Trennstrich" means "no hyphen") in IE7, Opera 8+ and Firefox, IE6 e.g. would reproduce an error. That´s why I decided to use <wbr>, because "only" Opera and Safari have problems with that... but as far as I can tell they are not so widespread and my stats told me that they are very few users with these browsers on my side... so... I think till there is the erfect solution I´ll stick to <wbr>...

I´ll have to read your found article later, I´m at work now... ;) And I´ll try to use your "code" and I´ll try it in my IE6 and FF2, let´s se what happens... if both browsers give me the same result, I´ll use it... Only because my source tells me that your linebreak is faulty in IE6... pah, in general I had no problems at all with the extra long URL in IE6 but only in FF!

43 Aug 07, 2007 10:30

Then there is no news in my previous post.

44 Aug 07, 2007 13:50

Hmmm, funny... have tried now your suggestion... and only tested it in FF2 and there (against what I have read in my linked page above) there was an addtional box where the linebrak should be... or shouldn´t be... therefore I didn´t tested in it IE and... again... I´ll stick to <wbr>...


Form is loading...