boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update to refererLib - top google queries

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
bdjohns1



Joined: 13 Aug 2003
Posts: 3

PostPosted: Wed Aug 13, 2003 3:43 am    Post subject: Update to refererLib - top google queries Reply with quote

I've added a few functions to the classic ncyoung refererLib to allow parsing of all of the google searches that led to pages which are being logged by refererLib.

Drop-in replacement for refererLib.php is here (download and rename)

http://www.ben-johnson.org/blog/refererLib.new.phps

Usage is pretty simple:

Code:

<ul>
<?php

  $list = googleList(5);

  foreach ($list as $link){

  print "<li>$link</li>";

  }

?>
</ul>


See it in action at http://www.ben-johnson.org/blog/ in the right-hand bar.[/url]

Let me know if you find any bugs, or recommendations to make it better...it's my 1st hack.
_________________
Ben's Weblog
Back to top
View user's profile Send private message Visit poster's website
XianghuaALPHA



Joined: 05 Aug 2003
Posts: 79
Location: Tulsa, OK

PostPosted: Wed Aug 13, 2003 4:07 pm    Post subject: Reply with quote

!!!!


Awesome man! I am still newer to the software - but MAN - this looks like a sweeeet addition! Thanks!



X A
_________________
[ [ - - There can be only 2 or 3 - - ]]

You know what. On a quite board - you end up talking to yourself alot....


Friends don't let friends play Tekken™
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
bdjohns1



Joined: 13 Aug 2003
Posts: 3

PostPosted: Wed Aug 13, 2003 6:58 pm    Post subject: Reply with quote

XianghuaALPHA wrote:
!!!!


Awesome man! I am still newer to the software - but MAN - this looks like a sweeeet addition! Thanks!



X A

Thanks! I saw the comment you left over at my blog, and to that, it should work as a drop-in for b2 as well as WordPress. All you need to do is create a new table in your b2 database (there's a function embedded in the php file that will do it for you, actually). It doesn't touch any WP-specific things.
_________________
Ben's Weblog
Back to top
View user's profile Send private message Visit poster's website
XianghuaALPHA



Joined: 05 Aug 2003
Posts: 79
Location: Tulsa, OK

PostPosted: Wed Aug 13, 2003 7:40 pm    Post subject: Reply with quote

bdjohns1 wrote:
XianghuaALPHA wrote:
!!!!


Awesome man! I am still newer to the software - but MAN - this looks like a sweeeet addition! Thanks!



X A

Thanks! I saw the comment you left over at my blog, and to that, it should work as a drop-in for b2 as well as WordPress. All you need to do is create a new table in your b2 database (there's a function embedded in the php file that will do it for you, actually). It doesn't touch any WP-specific things.



yeaa, see it's been hours since then and I've been into all this info!

Anyway, I'm very interested in TRULY understanding all these versions - as I've discovered it so far....


B2 Evo is just a version that a very nice guy went out and started building...


B2 is a great version - but beyond .6.2[.1?] there is no updates - and might never be?! And that is due to...


The 'official branch' is now - WordPress?! I see it as a scary interface intially heh - and I saw a comment somewhere that it's not very admin page advanced like B2 - but that it's more 'compliant' for search engine wise...


So - between me and a few others that are in my circle of 'what do we do guys' - we are trying to figure it out. Another guy's concerns is that

"my only concern about b2 is that they will like abandon the project and only actively develop WP... if that's going to be the case, then we might as well switch now."

I'm concerned about WP having better options - but no LJ update? Something I'm after so depserately to get BACK working on my blog now haha.

Man. Anyway - I don't figure all the awesome features you have on your site are 'standard Wordpress' as you can write hacks and all heh, and I see you've obviously departed from that standard face of WP - so it's possible and hopefully not hard - but - what of those other concerns... If we want the best blog software - we pretty much don't think anything other than B2 back'ended will be worth looking at... But what VERSION of what B2 backend? You use WP - because of better SE rankings? Or better permalinks? Or the fact that you understand the branch thing to be a 'killing of just b2' or?

All this because I wanted to print out the best readme.html file for B2 and study...

Arg, I appreciate ANY light you can thrown on this - as several of us and a entire local poetry community will be going off the decisions I help influence -_- Thanks again, man!


As for this hack - I can't wait to apply it!!! Very Happy



X A
_________________
[ [ - - There can be only 2 or 3 - - ]]

You know what. On a quite board - you end up talking to yourself alot....


Friends don't let friends play Tekken™
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
bdjohns1



Joined: 13 Aug 2003
Posts: 3

PostPosted: Thu Aug 14, 2003 2:23 am    Post subject: Reply with quote

XianghuaALPHA wrote:



yeaa, see it's been hours since then and I've been into all this info!

Anyway, I'm very interested in TRULY understanding all these versions - as I've discovered it so far....


B2 Evo is just a version that a very nice guy went out and started building...


B2 is a great version - but beyond .6.2[.1?] there is no updates - and might never be?! And that is due to...


The 'official branch' is now - WordPress?! I see it as a scary interface intially heh - and I saw a comment somewhere that it's not very admin page advanced like B2 - but that it's more 'compliant' for search engine wise...


So - between me and a few others that are in my circle of 'what do we do guys' - we are trying to figure it out. Another guy's concerns is that

"my only concern about b2 is that they will like abandon the project and only actively develop WP... if that's going to be the case, then we might as well switch now."

I'm concerned about WP having better options - but no LJ update? Something I'm after so depserately to get BACK working on my blog now haha.

Man. Anyway - I don't figure all the awesome features you have on your site are 'standard Wordpress' as you can write hacks and all heh, and I see you've obviously departed from that standard face of WP - so it's possible and hopefully not hard - but - what of those other concerns... If we want the best blog software - we pretty much don't think anything other than B2 back'ended will be worth looking at... But what VERSION of what B2 backend? You use WP - because of better SE rankings? Or better permalinks? Or the fact that you understand the branch thing to be a 'killing of just b2' or?

All this because I wanted to print out the best readme.html file for B2 and study...

Arg, I appreciate ANY light you can thrown on this - as several of us and a entire local poetry community will be going off the decisions I help influence -_- Thanks again, man!

As for this hack - I can't wait to apply it!!! Very Happy


Well, I basically went over to WP based on the fact that it was announced to be the new "stable" branch of b2. From an admin standpoint, I really didn't see any differences - the original WordPress release was really just a new template, some minor changes to the backend, and MikeLittle's b2links package integrated in. If you go into the backend, there are still files called "b2login.php", etc. Smile I think the biggest changes have been to how it interfaces with the database (using a library called ezSQL), and that in the CVS version, b2config.php is basically gone - almost all preferences are stored in the database (which is smart because that way if new functions are added, you don't need to overwrite the config).

As far as the hacks I've installed:

* b2quotes - adapted from here (really just some cleanup issues)
* permalinks - just adapting the instructions from b2. WP is going to have better permalinks in place sometime in the not too distant future.
* refererLib - pretty much drops right in. I just added the googleList function and a couple helpers.

It's really just a lot of trial-and-error work for me, since I'm pretty amateur with PHP myself. I've found that keeping a separate directory tree for testing hacks and stuff works good (since they can both look at the same database)
_________________
Ben's Weblog
Back to top
View user's profile Send private message Visit poster's website
KJ



Joined: 15 Jun 2003
Posts: 5

PostPosted: Sat Aug 23, 2003 4:00 pm    Post subject: Cleanup! Reply with quote

After a while the referer logs get too big, and also you may just want to show the last 30 days.

So, at the bottom of the function logReferrer() in the refererlib.php file, add the following code. The first few lines are what is already there, only add from the //30 day cleanup code on down.

Code:
   $anchor = preg_replace("/http:\/\//i", "", $ref);
   $anchor = preg_replace("/^www\./i", "", $anchor);
   $anchor = preg_replace("/\/.*/i", "", $anchor);

   $sql ="insert into referer_visitLog (referingURL,baseDomain,visitURL) values ('$ref','$anchor','$currentURL')";

   //print $sql;

   mysql_query($sql);
   
   // 30 day cleanup code add here down.  You can adjust the amount of data kept by changing the >=30 to >=7 for one week, etc.
   $sql ="delete from referer_visitLog where to_days(now()) - to_days(visitTime) >= 30";
   mysql_query($sql);
}
Back to top
View user's profile Send private message
XianghuaALPHA



Joined: 05 Aug 2003
Posts: 79
Location: Tulsa, OK

PostPosted: Wed Jan 07, 2004 5:47 am    Post subject: Reply with quote

Hey! I AM FINALLY GETTING TO USE THIS!

I know, how sad.

Anyway, I ran into a problem though.. I couldn't get my blog to work with the standard one as the original wrote.. but it would work with this advanced one -

http://tidakada.com/board/viewtopic.php?p=22292#22292

If you scroll up you can see yea.

Anyway - I am totally clueless still about this stuff, and as you can see there I've asked to know if he could think of anything / yea. Is there anything you can think of? I'm just at a lost - I want both functionalities - but they appear to DEFINATELY not play well with each other - I tried and got lovely php crashes and yea. Am sitting at the current version now. Anyway, any idea's or thoughts would help - thank you!
_________________
[ [ - - There can be only 2 or 3 - - ]]

You know what. On a quite board - you end up talking to yourself alot....


Friends don't let friends play Tekken™
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group