Recent Topics

1 Aug 16, 2007 09:22    

My b2evolution Version: 1.9.x

Hi,

I´m trying now for hours to build a YIGG script (German DIGG clone), which calls only an icon if my posting is not listed yet or the rating stuff, if the posting is already on YIGG.

Using a static URL and title is my test.php, everything works fine... but now I wanted to use of course the permanent-link and post-title functions from b2evo to work with it... but it does not work at all...

Here is what I have so far...

<?php 
$posttitle = $Item->title();
$postlink = $Item->permanent_url();
$get_yiggs_url = 'http://www.yigg.de/GetYiggs?exturl='.$postlink;
flush();
$ch = curl_init($get_yiggs_url);
$fp = @fopen("_yiggtempfile.tmp", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$file = "_yiggtempfile.tmp";
// if( $fp = file_get_contents($file,'r')>=1 )
if( file_get_contents($file,'r')>=1 )
{ echo'<div class="yiggbutton"><script>yigg_url="'.$postlink.'"</script><script src="http://webtools.yigg.de/emb_ycount.js"></script></div>'; }
else { echo '<a href="http://yigg.de/neu?exturl='.$postlink.'&exttitle='.$posttitle.'" target="_blank"><img src="http://www.chaoszone.de/blog/hacks/images/favicon-yigg.png" style="vertical-align: middle" border="0"></a>'; }
?>

Using for example

$posttitle .= 'Überteuerter Schnickschnack';
$postlink .= 'http://www.chaoszone.de/blog/webnews.php/2007/08/16/ueberteuerter_schnickschnack';

everything works great as I want it to... (in a separate php-file not integratet in b2evo!!!) ... but this solves not the problem... What did I have made wrong... I thing the handing over of the variables is not correct... but what exactly I have to modify?

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

2 Aug 16, 2007 14:52

I can't check or test run anything based on your code, but if you needed to append (dot =) the complete url to $postlink, I presume the original $postlink is blank.

Try

global $Item;


right after <?php and add some debug echo's to follow the content of the variables..

I am afraid it's something more difficult than this, but perhaps it gets you on your way B)

Good luck

3 Aug 16, 2007 16:05

Also this bit :

$posttitle = $Item->title();// will echo the title
$postlink = $Item->permanent_url();//will echo the url

should be :

$posttitle = $Item->title;
$postlink = $Item->get_permanent_url();

¥

4 Aug 16, 2007 16:13

No, it´s not really helping...

At the position I want to have the icon or the rating thing, the following text appears "Überteuerter Schnickschnackhttp://www.chaoszone.de/blog/webnews.php/2007/08/16/ueberteuerter_schnickschnack" plus the icon with the link to "http://yigg.de/neu?exturl=&exttitle="... not exactly what I want :'(

Then I tried the following only to see what happens:

if( file_get_contents($file,'r')>=1 )
{ echo 'ok'; }
else { echo 'not ok'; }

(of course with the rest of the code untouched...) and now I see the following result: "Überteuerter Schnickschnackhttp://www.chaoszone.de/blog/webnews.php/2007/08/16/ueberteuerter_schnickschnacknot ok"

I don´t know why... but I have to do something different with the definition of the first two variables I think,... this way it´s not working at all... any more ideas?

5 Aug 16, 2007 16:14

Hey GREAT ¥åßßå, this is working.... super!


Form is loading...