Members   Search      Help    Register    Login    Home
Home » Support Forums for PMBT 1.X » Development » Meta Tags & Titles
Meta Tags & Titles [message #1021] Wed, 09 May 2007 03:57 Go to next message
lodp is currently offline lodp  Austria
Messages: 336
Registered: June 2006
Releaser
I read up a little on search engine stuff, and it seems that while meta-tags aren't as relevant to search engines as they used to be, it still could help if pmbt generated meta-tags for torrents in the html head. Apart from that, the regular <title> - tag should contain the torrent name. People are more likely to click on that in Google, rather than just the site name.

I tried to generate these in header.php, but because of my near-illiteracy in PHP, I didn't get too far. It's probably the variables that don't work. This is what i did right after
Quote:

echo "<head>\n";


in header.php

echo "<title>".$sitename." -- ".$torrent["name"]."</title>\n";

echo "<meta name=\"title\" content=\"".$torrent["name"]."\" />";

echo "<meta name=\"keywords\" content=\"Download ".$torrent["name"]."torrent\" />";

echo "<meta name=\"description\" content=\"Download ".$torrent["name"]."torrent\" BitTorrent File-Sharing/>";


Can you help me with that, joe?

I could also imaging that it would be usefull to let uploaders enter keywords for their uploads (like i have on my old site), and load those into the meta-tags.

[Updated on: Wed, 09 May 2007 04:05]

Report message to a moderator

Re: Meta Tags & Titles [message #1022 is a reply to message #1021] Wed, 09 May 2007 11:29 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
umm yea that well help the unwanted find you wont it?
would it not be better to use robet.txt

sample of robot.txt
###############################
#
# sample robots.txt file for this website 
#
# addresses all robots by using wild card *
#
User-agent: *
# list folders robots are not allowed to index

Disallow: /tutorials/meta/
Disallow: /tutorials/images/
Disallow: /tutorials/assets/
Disallow: /tutorials/404redirect/
#
# list specific files robots are not allowed to index
#
Disallow: /tutorials/meta_tags.html
Disallow: /tutorials/custom_error_page.html
#
# End of robots.txt file
#
###############################

even the most popular search engene GOOGLE uses this.


http://a.imageshack.us/img831/5562/mybikes.png

[Updated on: Wed, 09 May 2007 13:04]

Report message to a moderator

Re: Meta Tags & Titles [message #1023 is a reply to message #1021] Wed, 09 May 2007 13:07 Go to previous messageGo to next message
lodp is currently offline lodp  Austria
Messages: 336
Registered: June 2006
Releaser
That's true -- you might run into trouble more easily. as for me, i may have less reason to worry about that than others have.

But there's an easy way to avoid any attention, if you want -- you can insert directions for search engine crawlers, and tell them not to index your site at all: http://www.robotstxt.org/wc/meta-user.html
Re: Meta Tags & Titles [message #1024 is a reply to message #1022] Wed, 09 May 2007 13:12 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
here are some tages for you to look at but you need to remember that you would need to add most of these to each page for them to work right.
Top Ten METAs for Search Engines

Suggested Robot META tags for use on ALL pages, in order of importance:

1. <META NAME="DESCRIPTION" CONTENT="place the page's description here">
This is what will be displayed on the search index page so write well and accurately!

2. <META NAME="KEYWORDS" CONTENT="place PAGE key words here, separated by commas">
Hint: Do not repeat words and keep the list short and specific to the page.

3. Choose ONLY ONE of the four Robot METAs below that apply to the page you place it on.

<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
Function: Robot indexes the page AND follow all links (Default state if no robots meta is specified)

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
Function: Robot does not index the page nor follow links (Good for a links page, shopping cart, etc.)

<META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW">
Function: Robot indexes the page but does NOT follow links

<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">
Function: Robot does NOT index the page but follows all links (Good for a transition page)

4. <META NAME="REVISIT-AFTER" CONTENT="30 days">
Options: This can be anything you want in days. Be realistic, if your site is rather static, go with 30 days or longer. If you do a weekly calendar of events, 5 days is is a good starting point for that individual page. You don't want to have robots scarfing up your pages every day if they are not changing.

5. <META NAME="RATING" CONTENT="viewer rating goes here (choose one from options)">
Options: general, adult, mature, restricted, 14 years, safe for kids

6. <META NAME="COPYRIGHT" CONTENT="Copyright © 2001 your information here, all rights reserved">

7. <META NAME="AUTHOR" CONTENT="your name or company name here">
This and the contact address below provides a way for individuals to contact you.

8. <META NAME="CONTACT_ADDR"="the contact E-mail or physical address for you or your company"> This and the author tag above provides a way for individuals to contact you.

9. <META NAME="DISTRIBUTION" CONTENT="Global">
Options: Local (or a specific geographic area such as New England, Western Europe, or Japan). Use Global unless you want your pages restricted to a certain geographic area. Use Local for intranet (internal company) sites that you do NOT want indexed along with a NOINDEX NOFOLLOW robots META and a robots.txt file restricting robot access to the pages.

10. <META NAME="RESOURCE-TYPE" CONTENT="document">
This tells the robot that the page is an html document and should be walked.


http://a.imageshack.us/img831/5562/mybikes.png
Re: Meta Tags & Titles [message #1025 is a reply to message #1021] Wed, 09 May 2007 19:21 Go to previous messageGo to next message
lodp is currently offline lodp  Austria
Messages: 336
Registered: June 2006
Releaser
OK, i think i'm almost there, getting the torrent name into the title, and the "description" + "keyword" meta tags.

i put this in header.php between the head tags:

Quote:

if(eregi("details.php",$_SERVER["PHP_SELF"])){
echo "<title>".$torrentname."</title>\n";
}


and this i put in details.php (right on top)

Quote:

$torrentname = $torrent["name"];


but that doesn't work. the variable isn't defined. what DOES work however, is if i assign the variable a fixed value in details.php:

Quote:

$torrentname = 1;


if i do that, every torrent page carries the title "1".

what's wrong? why can't the variable be valued with the torrentname here?
Re: Meta Tags & Titles [message #1026 is a reply to message #1025] Wed, 09 May 2007 19:25 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
it has to do with the location of the sql query
you cant have the torrent["name"] before the query


http://a.imageshack.us/img831/5562/mybikes.png
Re: Meta Tags & Titles [message #1027 is a reply to message #1021] Wed, 09 May 2007 19:55 Go to previous messageGo to next message
lodp is currently offline lodp  Austria
Messages: 336
Registered: June 2006
Releaser
what would be the correct place for this line then? or is it impossible?
Re: Meta Tags & Titles [message #1028 is a reply to message #1027] Thu, 10 May 2007 00:31 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
open header and find
echo "<title>".$sitename."</title>\n";

and change it to
if(!eregi("details.php",$_SERVER["PHP_SELF"])) echo "<title>".$sitename."</title>\n";

now open details and find
if (($torrent["password"] == "" OR $password == $torrent["password"]) AND isset($upcomplete)) {

and add before
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<title>".$sitename." :: ".addslashes($torrent["name"])."</title>\n";
echo"</head>\n\n";

now the torrent name well be added to the tab


http://a.imageshack.us/img831/5562/mybikes.png
Re: Meta Tags & Titles [message #1030 is a reply to message #1021] Thu, 10 May 2007 08:59 Go to previous messageGo to next message
lodp is currently offline lodp  Austria
Messages: 336
Registered: June 2006
Releaser
You're my hero, joe. works like charm!!

i'm worried a bit though -- when i view the resulting html, there's two <head></head> sections in the page. will the search bots be confused by that (given that they don't even like tables, for instance).

...

I also changed a couple of things in bittorrent.php (made the alt-attribute of the download link contain the torrent name, added the word "download" to the title attribute of the details link).

i also think i'm going to implement a "tags" - field in the upload form, so people can enter tags for their uploads. those could be loaded into the keywords meta-tag. and who knows, if the database is big enough, you could have something like a tag-cloud for the last 100 uploads or something, that'd be nifty.
Re: Meta Tags & Titles [message #1032 is a reply to message #1030] Thu, 10 May 2007 12:10 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
ok in details this
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<title>".$sitename." :: ".addslashes($torrent["name"])."</title>\n";
echo"</head>\n\n";

only needs to be this
echo "<title>".$sitename." :: ".addslashes($torrent["name"])."</title>\n";

this has been tested and passes w3chtml401 coding
so I dont see why it should bother a google bot.


http://a.imageshack.us/img831/5562/mybikes.png
Re: Meta Tags & Titles [message #1035 is a reply to message #1021] Thu, 10 May 2007 13:29 Go to previous messageGo to next message
lodp is currently offline lodp  Austria
Messages: 336
Registered: June 2006
Releaser
This validated fine for you? Wher did you test it?

When I just throw in the <title> tag in details.php like that, I get a W3C error, saying that that tag isn't allowed there (and also that the <head> tag in header.php has ended without a title).

When I wrap the <title> in <head> tags in details.php, it complains about those tags not being allowed there.

It's still working (that is, the title is being displayed). But I could imagine that bots were looking for the title (and any meta tags) in the head, and not the body, given that they're kind of picky regarding other things, hence the whole industry of Search Engine Optimization.
Re: Meta Tags & Titles [message #1038 is a reply to message #1035] Thu, 10 May 2007 13:38 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
http://validator.w3.org/check?uri=http%3A%2F%2Fphpmybittorre nttesting.info%2Fdetails.php%3Fid%3D50

it passes 3 out of 5 try's with out changing any thing


http://a.imageshack.us/img831/5562/mybikes.png
Re: Meta Tags & Titles [message #5239 is a reply to message #1021] Mon, 20 December 2010 20:38 Go to previous message
andy is currently offline andy  India
Messages: 8
Registered: December 2010
Location: india
Leecher
<meta> tag is used to give the description about the title in the google search page.
<title> is to give the title in the html page... it will view the top of the web page...
Previous Topic:COPYRIGHT NOTICE
Next Topic:upload down load
Goto Forum:
  


Current Time: Sun Feb 05 08:33:39 GMT 2012

Total time taken to generate the page: 0.01519 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software