Archive for the 'Misc' Category

h1

Pagination - php .htaccess paging code for seo

Wednesday, July 23rd, 2008

Over the last 2 weeks i’ve been working a lot on paging in php.

so… Pretty simple to get first last next and previous to work in php.

Looking at resources on the web I haven’t seen many paging php example including rewriting url for the search enignes so thought i’d put some code up here on my blog.. Hope it helps!

mysql_select_db($database, $con);

$query_prods = $query_list= “SELECT * FROM table”;
//echo $query_prods ;

$query_limit_prods = sprintf(”%s LIMIT %d, %d”, $query_prods, $startRow_prods, $maxRows_prods);
$prods = mysql_query($query_limit_prods, $con) or die(mysql_error());
$row_prods = mysql_fetch_assoc($prods);

The above code is a simple example of the php to create a recordset for the entire contents of “table”..

$maxRows_prods = 6;
$pageNum_prods = 0;

$all_prods = mysql_query($query_prods);
$totalRows_prods = mysql_num_rows($all_prods);
$totalPages_prods = ceil($totalRows_prods/$maxRows_prods)-1;

$queryString_prods = “”;
if (!empty($HTTP_SERVER_VARS[’QUERY_STRING’])) {
  $params = explode(”&”, $HTTP_SERVER_VARS[’QUERY_STRING’]);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, “pageNum_prods”) == false &&
        stristr($param, “totalRows_prods”) == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_prods = “&” . implode(”&”, $newParams);
  }
}

The above part of the php paging code creates variables to create a simple mod-rewrite php paging.

<?php

$currentPage  = “some-keyword/”

if ($pageNum_prods > 0) { // Show if not first page ?>
            <a href=”<?php echo $currentPage; ?>”><img src=”first.gif” border=”0″></a>
            <?php } // Show if not first page ?> </p>
        <?php if ($pageNum_prods > 1) { // Show if not first page ?>
            <a href=”<?php echo $currentPage.”/”.($pageNum_prods - 1); ?>”><img src=”prev.gif” border=”0″ align=”bottom”></a>
            <?php } // Show if not first page ?>
      <?php if ($pageNum_prods < $totalPages_prods) { // Show if not last page ?>
            <a href=”<?php echo $currentPage.”/”.($pageNum_prods + 1); ?>”><img src=”next.gif” border=”0″></a>
            <?php } // Show if not last page ?>
   <?php if ($pageNum_prods < $totalPages_prods) {?><a href=”<?php echo $currentPage.”/”.($totalPages_prods); ?>”><img src=”last.gif” border=”0″></a><?php }?>

The above code shows image for first, next, previous and last however you can of course slam in some keywords here either in the alt tags or as text.. I’ll explain how in a bit..

RewriteCond %{REQUEST_URI} ^/somekeyword/([0-9]+)
RewriteRule ^(.*) /page.php?pageNum_prods=%1  [L]

The above is the .htacess for paging a php page called page.php in the root of the site. Please note “somekeyword” can be changed to theme the paging for example if the query returned all products that are ”red” then the folder could be called “red” to give a little seo help..

The above coding will result in yoursite.com/somekeyword/1 for page 1 yoursite.com/somekeyword/2 for page 2 and so on..

The above is a very simple basic script which I hope helps however now you can start to take it up a gear in regards to seo..

So paging has always been a issuse with SE as page 1 will return the same title des and k/w as page 2 and so on … so how to fix the dup content?

Well always consider the user so look at the result on the page..  Look at them as a human.. What is on the page? How could you describe it ?  The above php limits to 6 results per page..  those 6 items each have a title.. Now depenant on your data the is the key!..

Lets assume your in the RED section of the site so the query retrun all red items.. In the first 6 you have what type of items ? These items are the content of the page along with what that page links to.. By extract the type of items your be able to add them to title and desriptions..

So again assuming RED items include pens,ink,paper,paint… collect this data in array.. Now the key so make sure its reads well to the user. So something like “page 1 red items” could be change to “Red pens, ink paper and paint from xyz”

Basically your giving the user the title + description to what is on the page.. as above if page 2 contained card, cloth,fabric,thick paper .. The title would change from something like “page 2 red items” to “Red card, cloth, fabric and thick paper from xyz”

Of course using “,” in titles and description isn’t a great idea thus its worth looking into this wording dependant on your niche..

Hope that helps someone a little :)

h1

Mr site hit by Trojans ..

Wednesday, June 25th, 2008

If you haven’t heard of Mr site is a massive cheap cms .. basically a website in a box..

I know loads of people who use it to try selling on the web as it cheap and a pretty good cms for newbies.

Over the weekend and notice went out as follows:

Due to continual problems with Trojan Viruses on the Mr Site servers we would recommend you do not update or republish your site until Mr Site has emailed all users to confirm that this has been rectified.

Mr site has removed its support forum a while back but a unoffical site was setup here: http://www.mrsitemembers.proboards79.com/ 

I hope this guys get it sorted as I know of many unhappy customers who can’t change/update their sites.

This may have a major effect on the UK serps if google block/warn searchers about this…

Mr site, site is down too.. http://www.mrsite.com/   some crazy s**t going on here..

I’m getting 1.4 million indexed pages on google see this link: http://www.google.co.uk/search?q=%22created+at+www.mrsite.com 

I guessing maybe 100,000’s of sites are effect as many of these sites are tiny e.g. 3 pages etc..

 

h1

Watch what you say?

Wednesday, February 6th, 2008

I’ve just been looking at some of my referrals from yesterday..

I came accross pipl.. I’ve seen it before and the data it has on me and my friends if pretty amazing..

Its tagged me/friends with some of the keywords that we have been seo’ing for a while..

I’ve also seen ICQ listings with address and phone number etc of friends.. It would seem this site has gathered more info than when I last looked.. It would be a great tool for people to checkout who is who…

Word of warning use a aka that in no way relates to you OR be open with what you do… If your outspoken which i’m not then I’d look at the aka route..

Anyway enjoy looking up your friends or seo’s here: http://pipl.com

 

 

h1

The A to Z of social sites..

Friday, January 11th, 2008

No this isn’t a guide.. OR a top 10 OR a How to LOL..

This is my A to Z list of Social sites…

 

Most you are likely to know but I put a few golden ones hidden in the list ;) Enjoy …

 

So lets kick off with no other than A

NOTE: PR and Alexa are what I see in my browser right now 

 

A - http://www.agentb.com/  - Shopping - general - PR3 - Alexa 300k +

B - http://photobucket.com/  - photo - general - PR8 - Alexa 33

C - http://www.contentpop.com/ News - general - PR4 - Alexa 200k +

D - http://del.icio.us/  Book marking - Everything - PR8 - Alexa 388

E - http://www.espinthebottle.com/  Teen - Sick and wrong lol - PR5 - Alexa 15k+ (wow)

F - http://www.furl.net/ Info / news - General - PR7 - Alexa 5K+

G - http://www.godtube.com/ God stuff - video - PR5 - Alexa 7k+

H - http://www.hanzoweb.com/   Archiver - PR5 - Alexa 100k+

I - http://www.icerocket.com/ General - PR7 - Alexa 12k+

J - http://www.jeteye.com/  Jet packs - General - PR6 - Alexa 100k+

K - http://www.kaboodle.com/ Shopping - Shopping advice - PR6 - Alexa 500+

L - http://www.librarything.com/ Book - Lidraries world wide - PR7 - Alexa 17k+

M - http://www.mostfashionable.com Fashion - Shopping - PR6 - Alexa 500k+

N - http://www.newsvine.com/  News - General - PR7 - Alexa 5k+

O - http://www.oyax.com/ General - General - PR4 - Alexa 51k+

P - http://www.plugim.com/ General - General - PR4 - Alexa 30k+

Q - http://www.qoolsqool.com/ Book - Study - PR4 - Alexa 300k+

R - http://www.rrove.com/ Map -Trips and tips - PR3 - Alexa 350k+

S - http://www.stylehive.com/ Shopping - Style - PR5 - Alexa 16k+

T - http://www.technorati.com/ Blog - Blogging - PR8 - Alexa 400

U - http://upian.com/  Web - French - PR6 - Alexa 250k+

V - http://www.virb.com/ General - Music themed - PR6 - Alexa 12k+

W - http://www.wists.com/ Shopping - Images - PR6 - Alexa 36k+

X - http://www.xing.com/ People - Job - PR7 - Alexa 1K+

Y - http://www.yoono.com/ General - Like SU - Alexa 72K+

Z - http://www.zebo.com/ Shopping - Cool stuff - Alexa 12k+

 

h1

New bbc homepage killed My IE and FF

Friday, December 21st, 2007

I’ve been IM’d by a load of people about the new bbc homepage..

Bascially the bbc have just put live the new code but all hasn’t gone to plan..

 This is what a load of people have being seeing..

 

The real problem I have was I had to end task on both IE and Firefox after trying to view the bbc as it completely killed my browsers!!

 

Good luck beeb

www.bbc.co.uk

h1

BBC goes all web 2.0

Friday, December 14th, 2007

 Functionally is a cool new home page but the font is a little to big…

 I know web 2.0 is all massive fonts etc but come on..

BTW I’m not the only one that said that..

 

 

 You can of course edit the homepage to fit your need like igoogle and many other…

Enjoy playing :)

 

http://www.bbc.co.uk/home/beta/

 

 

h1

The new world… (for me)

Wednesday, December 12th, 2007

I can’t say to much (yet) but hope to write about a new project and hope it wil help some folk that may come accross a similar change..

Basically and massive u-turn for a site I work with from selling online to advertising online.. The traffic is very high quality and come in massive amounts with great press coverage..

Its going to be interesting and i’ll try and write a bit about the transition as I go..

One massive bonus is the amount of time this will free up which opens new doors as I’ve haven’t been interested in new clients for over 4yrs now and with spare time is can expand…

Its pretty amazing how some drunk on the train was singing “all change” something.. (I could only make out those words) this morning on the commute into london at 9am this morning and the chance you meet a new client on the train the night before.. hmmm ..

 

 

h1

SearchMarketing Standard - Winter 2007

Wednesday, December 5th, 2007

I’ve been waiting to get my hands on the latest copy of sms…

However it hasn’t arrived but I need to post about the offer regarding the discount subscription..

Its really simple..

The Magic coupon will provide you with a 67% discount, so a 1 year International - $6.60 (that us in the UK) , U.S. subscription would be $4.95

As soon as I get my copy I’ll write a little review…

Almost forgot the $1 from each subscription goes to Toys for Tots.. Great news..

Anyway here is the cover:

 

And the magic code is… : HOLIDAY67

Valid till the 10th December..

 (Already sold 2 for you guys )

 https://www.searchmarketingstandard.com/subscribe.html

 

 

 

h1

Postreach back online..

Wednesday, December 5th, 2007

I like postreach ..

Its a bit of fun but I was not happy with them yesterday!!!!

Basically the site was down due to maintenance.. Fine.. That part of life.. BUT the problem was the fact the when your blog tried to load the end of a post where the “postreach” voting buttons are the bowser would just STOP!

My first thought was someone has deleted all my posts LOL… Anyway .. Plugin is back on now and I hope in the future Postreach well make a work around as it would take seconds vs killing everyone’s blogs!!!!

 

h1

The twittering is back..

Thursday, November 29th, 2007

Up until last week my twittering was running at about a post a month lol..

The bird was almost DEAD!

 

BUT

Now she’s back..

And fighting FIT!

 

 

See widget / badge top right or join me twittering away: http://twitter.com/gabs