Trying to identify plugin
-
There’s a plugin at Coldforged.org, in the sidebar on the top, telling the user how many new items (posts and comments) have been published, and uses a cookie to track the user’s last visit. I am not sure if this is publicly available plugin or a personal hack (the webmaster there is very talented, but doesn’t openly give his email or I would have asked personally) so if anyone knows if it is, please help me put this on my website as well. Thanks in advance.
-
Okay, I’m back at this again.
I believe I’ve put everything where it should be.
– the index.php has this in it:
<?php if (have_posts()) : ?>
<?php // show indicator if post is new
ak_new_post(); ?><?php // show indicator if comment(s) are new
ak_new_comments(); ?>– header.php has this at the very beginning of the document:
<?php // set lastvisit cookie
ak_set_last_visit_cookie(); ?>– and sidebar.php has:
<?php // show # new posts/comments banner
ak_since_last_visit(); ?>
<?php ak_new_post(); ?>I’ve placed the “wp-last_visit_no_js” here: http://www.familywebwatch.com/blog_test/wp-last_visit_no_js
– the folder containing the images (“ak-img”) also resides in the folder above.So when I access my blog I get this error message:
Fatal error: Call to undefined function: ak_set_last_visit_cookie() in /hsphere/local/home/galen5/familywebwatch.com/blog_test/
wp-content/themes/Blix/header.php on line 2Can you find anything screwy here?
How about removing those // comments from the <?php ?> codes? I haven’t put any, and it works for me.
davincim, where do you have the
<?php require_once("wp-last_visit.php"); ?>?Thanks you two!
@raynerape – I removed them; looked kind of weird anyway. 🙂
@minna – Good call. I missed that one, but adding it didn’t make the error go away unfortunately. I added it near the top of my index.php:
<?php if (have_posts()) : ?>
<!-- since last visit -->
<?php require_once("wp-last_visit.php"); ?><?php ak_new_post(); ?>
<?php ak_new_comments(); ?>
<!-- end -->The instructions say to also put it in the wp-comments-popup.php (a.k.a. comments-popup.php for v1.5, right?), but I don’t use popups for my comments. Does that mean it should go in my comments.php?
I should also correct something I said earlier. I said “wp-last_visit_no_js” was placed in the blog root. I should have said “wp-last_visit.php”.
Btw, the file has this in there:
// Modified by Dougal Campbell <URL:http://dougal.gunters.org/> 20030911
// replaced mysql_*() calls with ezSQL calls
// modified cookie code to derive info from $siteurl
// renamed cookies with ‘wp’ instead of ‘b2’
//
// include this file or paste the functions into your page// set $path and $domain as appropriate to your server. In most cases,
// you’ll want $path to match your WordPress install directory. If your
// site is accessible by multiple subdomain names, like “example.com”
// and “www.example.com”, then set $domain to “.example.com”// By default, we’ll try to derive them from the site url defined
// in the Base Settings options:
$urlinfo = parse_url($siteurl);$path = $urlinfo[‘path’];
$domain = $urlinfo[‘host’];Am I at the point of needing to spell it out for this to work, or do you think it knows where to look for the information it’s seeking (i.e. path, domain)?
Again thanks for helping me. I feel we’re close to fixing it (crosses fingers).
I have
<?php require_once("wp-last_visit.php"); ?>in myhacks.php (without the <? stuff because myhacks is in a big php tag block, at least mine is) and I assume it (myhacks.php) gets run first. You need to put that (<?php require_once("wp-last_visit.php"); ?>) as the very first thing on your page. That is either in myhacks.php or in header.php as the first thing (before setting the cookie), thus:
<?php
require_once("wp-last_visit.php");
// set lastvisit cookie
ak_set_last_visit_cookie();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
(doctype/html is there for just as an example, don’t replace yours)As you don’t use popup comments you don’t have to worry about putting require_once in any comment related templates. If the comment page was a separate html block (as is the case for popups), you’d need it.
So, one more try 🙂 (don’t get me wrong, I’m up for lots more) The require_once doesn’t go as the first thing in the Loop, but the whole page. Even before doctype and setting the cookie (see example above).
If even that doesn’t help, you could try putting the domain name manually. I didn’t even notice that bit…
Yes, hopefully it’ll start working. I’m determined to get it working! 🙂 (Hopefully my reply makes any sense, it’s a bit long — if I’m blabbing something no one understands, tell me)
Ohmygosh, Minna! It worked…well, almost. Your instruction to include
<?php
require_once("wp-last_visit.php");
// set lastvisit cookie
ak_set_last_visit_cookie();
?>all together I think it was did the trick (sorry I missed that earlier). My sidebar now says:
0 new posts and 0 comments since your last visit on April 4, 2005 @ 1:35 pm
Now that we’re in to the homestretch, I need just a little more help to make sure I can get the images showing. Here’s my code for the index: http://www.pastebin.com/267060
I’ve placed the indicators just below
<?php if (have_posts()) : ?>. I’m guessing they need to be moved somewhere closer to the post title, so should I put them next to, say,<h2><a href="<?php the_permalink() ?>" title="Permalink to: <?php the_title(); ?>"><?php the_title(); ?></a></h2>(around line 58 I think)?Also, if I’m not mistaken, I figured I should have the image I want it to call as the only image in the ak-img directory. Is that right?
And lastly, to test I sent a post to see what would happen. The text in my sidebar didn’t change. I suppose that’s because my blog figures if I’m there when it was posted, then it’s not really new. So is the trick to deleting the cookie?
Minna, you’ve been amazingly helpful. I appreciate your endurance. 🙂
Is this double Loop intentional (or not double *loop* but anyway):
<?php if (have_posts()) : ?>
<!-- since last visit -->
<?php ak_new_post(); ?>
<?php ak_new_comments(); ?>
<!-- end -->
<?php while (have_posts()) : the_post(); ?>
or did you add it based on my instructions? If you did, then you can take it away and put the ak_new_post() and ak_new_comments() somewhere in the post’s information. The place you suggested for new post indicator (h2) is good and the other should be somewhere close to the link to comments (near<?php comments_popup_link('Add comment', '1 comment', '% comments', 'commentlink', ''); ?>).What else… oh, the image. I’ve changed the code a bit because I put the image in a different folder, but in several functions (in wp-last_visit.php) you can see an img tag in the function call after
$html. There you can see what image it’s looking for and change the name/path the way you want it to be.Hmm… the 0 posts 0 comments is baffling me now. *picks up her magnifying glass*
Minna – with your help I got it to work! [leaves keyboard to do a victory dance…]
I had to fiddle a little bit with the placement, but got the images where I want them PLUS the text at the top of my sidebar is reading 1 post and 2 comments, blah blah.
If I could ask just one more thing (pretty pretty please 🙂 ), I can’t get it to behave correctly on the post page. Look at this first:
http://familywebwatch.com/blog_test/2005/04/04/another-new-post/#comments
The first and only comment says it’s from site admin and so on, and just before the gravatar there’s “NEW” in text. I’ve outlined the path to the image just like all the other functions, but this one’s being stubborn (okay, okay, it’s not; most likely it’s me).
Do you have any ideas for that one?
I really could NOT have done this without you, Minna. Thank you so much. 😉
Hmmm, I think something’s broke. Whenever I clicked on my pages in my top nav bar (“Contact”, “Archive”, etc.) I get the following message:
Warning: Cannot modify header information – headers already sent by (output started at /hsphere/local/home/galen5/familywebwatch.com/blog/wp-content/themes/Blix/contact.php:7) in /hsphere/local/home/galen5/familywebwatch.com/blog/wp-last_visit.php on line 55
If I read the first sentence correctly, then line 7 of contact.php is:
<?php get_header(); ?>And line 55 of wp-last_visit.php is:
);My site is: http://familywebwatch.com/blog/
Any thoughts as to why this is happening?
Thanks for that, Kaf. Armed with that information, I searched through my files and didn’t find any extra space. The only file I’m suspcious of is the plug-in itself (which isn’t something you activate, btw; it’s sitting in my blog root).
Anyway, that file starts out with this:
<?
// WP Since Last Visit
// version 1.3, 2004-01-16
//
// Copyright (c) 2002-2004 Alex King
// http://www.alexking.org/software/wordpress/
//
// This is an add-on to WordPress weblog / news publishing tool
//I guess I was anticipating a
<?phpat the beginning. I tried it with that modification and it still didn’t change anything.Any other ideas are welcome. 🙂
Can anyone suggest a solution to my header problem?
As you might have seen above, I modified the header.php with:
<?php
require_once("wp-last_visit.php");
// set lastvisit cookie
ak_set_last_visit_cookie();
?>Could that have anything to do with it?
The topic ‘Trying to identify plugin’ is closed to new replies.