Page 1 of 1

visits to a blog

Posted: Wed Oct 05, 2005 2:56 pm
by sweety
hi all,
I have included a new functionality in my site wherein the admin person can view the name of the users who visited the blog..this can be done by clicking on the hits beneath every blog...its working fine but when the user gives votes to any blog then the functionality is not working...when i checked where the problem is existing i found that .....in normal condition i am able to get the entryid but when clicked on karma ++/+/0/-/-- links the entryid is equating to the value of the one clicked...for example if i click ++ then the entryid its taking is 2(votes) and so on...can anyone please help me as to what is happening when i click on the karma links and how can i get the entryid in such a case???? :(

Re: visits to a blog

Posted: Wed Oct 05, 2005 3:24 pm
by garvinhicking
Uhm, can you try to explain this more in depth, with full sentences? :) I don't really understand your problem, I'm sorry!

Best regards,
Garvin

Posted: Fri Oct 07, 2005 5:52 pm
by Guest
hi garvin,
i am sorry for the late reply and also sorry for not being clear in my doubt..
under every blog there is a link like karma for this article ++/+/0/--/-
when we click on them it shows the value according to the link..for example if we click on ++ it shows the value as "2 voting" and if click on + it shows "1 voting" and so on...now i added a new link beneath this which gives me the number of hits(no.of times that blog is viewed)...on clicking this hit link a window opens which shows the users who viewed the blog and also the no.of times they viewed...
my problem is ,the code which i wrote for this to work is working fine before clicking on these karma links...once we click on any one of them it is showing me that no users viewed the blog but the no.of hits are displaying correctly........ i made the modifications in the code at the plugin serendipity_event_karma ......
one more thing in my code is, once i click on the hit link ...the window displays the details by taking the entryid ...but after clicking on these karma links it is not able to retrieve the entryid,it is taking the no.of votings instead..
can u tell what is actually happening once we click these karma links and can u suggest me any solution for my problem???
i hope i am clear......:-(

Posted: Fri Oct 07, 2005 5:56 pm
by garvinhicking
Well, this seems like you broke the karma plugin. To tell you more I need your modifications, of course. :-)

Best regards,
Garvin

Posted: Mon Oct 10, 2005 2:58 pm
by sweety
hi garvin.
i am sending you the code where i have made the changes...
the change where i made is...
here we have three variables $karma_voting ,$karma_current ,$karma_timeout
in these variables i used a new variable called $hitlink which is defined in the if-else condition as below......


Code: Select all

if ($serendipity['serendipityUserlevel'] >= USERLEVEL_CHIEF) 
{
   $hitlink='<a href="javascript:void(0)"  onClick=window.open("/visited.php?entry=[b]%1$s[/b]","VisitedUsersList","height=400,width=400,left=600,top=300,scrollbars=1,resizable=1"); >'.PLUGIN_KARMA_VISITSCOUNT.'</a>';
}
else{
   $hitlink=PLUGIN_KARMA_VISITSCOUNT;
      }
$karma_voting = '<br /><div class="serendipity_karmaVoting"><a id="karma_vote%1$s"></a>' . ($karma_active ? PLUGIN_KARMA_VOTETEXT . ' ' . $link_1 . ' | ' . $link_2 . ' | ' . $link_3 . ' | ' . $link_4 . ' | ' . $link_5 . '<br />' . PLUGIN_KARMA_CURRENT : '') . ($track_clicks ? $hitlink : '') . '</div>';

$karma_current = '<br /><div class="serendipity_karmaVoting"><a id="karma_vote%1$s"></a>'. ($karma_active ? '<div class="serendipity_karmaSuccess">' . PLUGIN_KARMA_VOTED . '</div>' . PLUGIN_KARMA_CURRENT : '') . ($track_clicks ? $hitlink : '') . '</div>';

$karma_timeout = '<br /><div class="serendipity_karmaVoting"><a id="karma_vote%1$s"></a>' . ($track_karma ? '<div>' . sprintf(PLUGIN_KARMA_CLOSED, $karmatime) . '</div>' . PLUGIN_KARMA_CURRENT : '') . ($track_clicks ? $hitlink : '') . '</div>';


this is the code wherein i added a new variable $hitlink....can u see the variable %1$s ....that variable actually contains the entry id..but after clicking on karma ++/+/0/--/- which i was telling you previously that variable no longer holds the entry id.....i hope u understood my problem
and can help me please.......
thank you

Posted: Mon Oct 10, 2005 3:21 pm
by garvinhicking
Yes, the entrid variable may not always be set. You need to check for $serendipity['GET']['id'] first!

Regards,
Garvin