Closed profcaju closed 2 years ago
I haven't used this extension for long time, it seems that the DB api changed and this extension has to be updated:
Not sure when I will get time to it, might not be something complex to code in php, the code is rather minimal, but I don't have a system running this extension at this moment where I could test new code.
Oh, good!!! I just managed to make it work after reading the link you've sent me :D
Changing lines 34 to 43 from your currrent code to:
$sql = "SELECT a.shorturl AS shorturl, count(*) AS clicks, b.url AS longurl FROM `$table_log` a, `$table_url` b WHERE a.shorturl=b.keyword AND DATE_SUB(NOW(), INTERVAL $numdays DAY)<a.click_time GROUP BY a.shorturl ORDER BY count(*) DESC LIMIT $numrows";
$query = $ydb->fetchAll($sql);
if ($query) {
foreach( $query as $query_result ) {
$outdata .= '<tr><td>' . $query_result['clicks'] . '</td><td><a href="' .$base .'/' . $query_result['shorturl'] .'+" target="blank">'
. $query_result['shorturl'] .'</a>'
. '</td><td><a href="' . $query_result['longurl'] .'" target="blank">'
. $query_result['longurl'] . '</td></tr>';
}
}
Thanks for your help 🤗
Oh, good!!! I just managed to make it work after reading the link you've sent me :D
Changing lines 34 to 43 from your currrent code to:
$sql = "SELECT a.shorturl AS shorturl, count(*) AS clicks, b.url AS longurl FROM `$table_log` a, `$table_url` b WHERE a.shorturl=b.keyword AND DATE_SUB(NOW(), INTERVAL $numdays DAY)<a.click_time GROUP BY a.shorturl ORDER BY count(*) DESC LIMIT $numrows"; $query = $ydb->fetchAll($sql); if ($query) { foreach( $query as $query_result ) { $outdata .= '<tr><td>' . $query_result['clicks'] . '</td><td><a href="' .$base .'/' . $query_result['shorturl'] .'+" target="blank">' . $query_result['shorturl'] .'</a>' . '</td><td><a href="' . $query_result['longurl'] .'" target="blank">' . $query_result['longurl'] . '</td></tr>'; } }
Thanks for your help 🤗
wow, thanks for this, your code indeed fixed my issue. thanks for sharing the correct code
Thanks! I pushed the suggested changes - commit referenced above.
Hello.
I used to use a lot this extension in my old server (Ubuntu 16.04 with Yourls 1.7).
But, after upgrading to Ubuntu 20.04 and Yourls 1.9, I get this error with this extension whenever I try to see the popular linkks
Is there some bug with this extension an Yourls newest version? Or is something I am missing in my installation?
Kind regards,