Previous Thread
Next Thread
Print Thread
Rate Thread
#225024 09/23/2002 11:49 AM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Hello All

ubbthreads sent me over here -- so here I am :-)

Is it possible to insert the thread subject as the meta title tag? While at it, how about the first 140 characters of the text as the meta description?

In our case, this would highly beneficial for our Google ranking in particular.

Thanks. Fred

Sponsored Links
matej #225025 09/23/2002 12:35 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Agreed... if I see how, I'll report back

And welcome


- Allen wavey
- What Drives You?
matej #225026 09/23/2002 1:07 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok, let me see if I can explain this correctly... lol



Go to your Admin area and chose to edit your configure file.

At the very bottom of the configure screen you should see a text area just below this line "The following variables are unknown to the base UBB.threads package, but might be used by installed hacks or modifications to the program:"

In that text box create a variable like so:

$config['meta_tags'] = "";




Ok now in your ubbt_header.tmpl file, located in your ubbthreads/templates/default directory just after the <head> tag add this:

{$config['meta_tags']}

and remove this:

<title>$inputTitle - {$ubbt_lang['POWERED_BY']} UBB.threads™</title>




Ok, now in your showflat.php file find this:
code:

$query = "
SELECT B_Replies,B_Counter,B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating
FROM {$config['tbprefix']}Posts
WHERE B_Number = $current
";
$sth = $dbh -> do_query($query);
list($checkreplies,$count,$posted,$tsubject,$Rating,$Rates,$stars) = $dbh -> fetch_array($sth);



and change it to this:

code:

$query = "
SELECT B_Replies,B_Counter,B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating,B_Body
FROM {$config['tbprefix']}Posts
WHERE B_Number = $current
";
$sth = $dbh -> do_query($query);
list($checkreplies,$count,$posted,$tsubject,$Rating,$Rates,$stars,$Body) = $dbh -> fetch_array($sth);
$metaKeywords = $tsubject;
$metaDescription = substr($Body,0,139);
$config['meta_tags'] = "<title>$tsubject</title>";
$config['meta_tags'] .= "<meta name="keywords" content="$metaKeywords" />";
$config['meta_tags'] .= "<meta name="description" content="$metaDescription" />";






In your showthreaded.php script find this:

code:

$query = "
SELECT B_Main, B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating
FROM {$config['tbprefix']}Posts
WHERE B_Number = $Number
AND B_Board = '$Board'
";
$sth = $dbh -> do_query($query);
list ($current,$posted,$tsubject,$Rating,$Rates,$stars) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);



and change it to this:

code:

$query = "
SELECT B_Main, B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating,B_Body
FROM {$config['tbprefix']}Posts
WHERE B_Number = $Number
AND B_Board = '$Board'
";
$sth = $dbh -> do_query($query);
list ($current,$posted,$tsubject,$Rating,$Rates,$stars,$Body) = $dbh -> fetch_array($sth);
$metaKeywords = $tsubject;
$metaDescription = substr($Body,0,139);
$config['meta_tags'] = "<title>$tsubject</title>";
$config['meta_tags'] .= "<meta name="keywords" content="$metaKeywords" />";
$config['meta_tags'] .= "<meta name="description" content="$metaDescription" />";





Hope this helps.


I left the meta keywords in because not all search engines are powered by google.

Last edited by JustDave; 09/25/2002 9:39 AM.
SurfMinister #225027 09/23/2002 1:08 PM
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Will search engines still pick up the META tags if they are in the body, and not in the head of the webpage? If so, then it would be fairly easy and probably not require any more queries on the showflat.php page. If an extra query has to be done for the header, then it would slow down a large or busy board.

neuron #225028 09/23/2002 1:24 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The modification I posted makes no extra queries.



Edit Note: Forgot to mention that placing the meta tags in the body would probably be a big no no for XHTML validation.

Last edited by JustDave; 09/23/2002 1:36 PM.
Sponsored Links
sjsaunders #225029 09/25/2002 8:45 AM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Thanks Dave

Not really but it’s a good start - looks straight forward. Give me hint on changing the $metaKeywords to lower case.

As to the <title></title> tag (that's what I meant), it is the single most important factor, followed by the description. They keywords don't weight much because of abuse. I've got hundreds of #1 listings to back that up. Look up chef forums, chef discussions, chef community, chef guide at google…

The title tag now displays the header-insert from the admin panel. That contains the phrase “Chef Guide Community Forums” which I can add to the metaKeywords and metaDescription easy enough to at least retain top billing with my main theme.

Here’s the kicker. If the thread subject is on “canning vegetables”, that now appears in the description and keywords, it won’t get you past page 3 of the search engine output. (no one will find it). Would it also appear in the <title></title>, with a good page ranking and a text body that speaks about canning vegetables, you’re top ten.

So the exercise really won’t yield much, other than some stray hits. So I think it is very important for the success of forum operators to address this issue in future releases so we don’t have to violate copyrights.

Fred Roosli
Chef2Chef.Net


matej #225030 09/25/2002 8:53 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
As it stands, the thread being viewed has the subject appended to the page's title. Perhaps what ever variable that is being used to do this can be modified without stepping on license issues. The whole title thing has been a questioned many times before by others. I honestly don't know how else to handle anything dealing with the title other than "don't touch" after reading the licensing agreement.

sjsaunders #225031 09/25/2002 9:27 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Straight from Rosemary.....

The "Powered by UBBThreads" in the TITLE (not at the bottom) may be edited or removed. They are only concerned with the notice at the bottom.

Josh

Daine #225032 09/25/2002 9:30 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks Josh

I'll edit my instructions above to include modifying the title on the fly accordingly

sjsaunders #225033 09/25/2002 9:37 AM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Boy, I just had to look at the source...thought I missed something.

My board does not append the subject of the thread

<title>Chef Guide for Chefs: Community Forums at Chef2Chef.Info</title>

If that were the case, problem solved...

Sponsored Links
matej #225034 09/25/2002 9:41 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I just edited my instructions. Let me know how it goes.

sjsaunders #225035 09/25/2002 9:58 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That's always been a confusing issue if we can touch that....
Someone asked at community....and I PMed her and asked her to ask for sure.

Here is the official word.

Daine #225036 09/25/2002 12:04 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Just in case that post gets lost

Sorry, glad you asked about that detail! You CAN remove the powered by wording that appears in the browser title. You cannot remove the powered by wording that appears on the forum pages.

Rosemary O'Neill Sep 17, 02 18:20

joeuser #225037 09/25/2002 1:40 PM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Smart idea

sjsaunders #225038 09/25/2002 1:46 PM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Thanks Dave

The revised code looks simply mavellous!

Fred

sjsaunders #225039 09/27/2002 6:28 AM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Dave

I got throught the first two steps just fine. After the third step, the showflat.php, I received this error message:

SQL ERROR: Unable to do_query: SELECT B_Replies,B_Counter,B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating FROM Posts WHERE B_Number = 10274
Table 'forum.Posts' doesn't exist
Warning: Supplied argument is not a valid MySQL result resource in [removed some info here ] /htdocs/ubbthreads/mysql.inc.php on line 83

What might that be? I am running 6.0.3, different table name?

Fred

matej #225040 09/27/2002 7:55 AM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
$config['tbprefix'] was added in 6.1.

For 6.0.3, you'll either need to add $config['tbprefix'] = "w3t_"; to the config file, or in the query, replace {$config['tbprefix']}Posts with w3t_Posts.

matej #225041 09/27/2002 8:19 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Dave_L is correct. I only have 6.1 sitting in front of me so anything I do is based off of that. Sorry about that

If you follow Dave's instruction that should fix the problem.


sjsaunders #225042 09/27/2002 5:48 PM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
No problem and no need looking like this

You've been a great help. So what's another few ounces of midnight oil...

Fred

joeuser #225043 10/18/2002 4:44 AM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Hi Dave

I finally got around to give this a twirl. Yes it worked with the w3t_Posts change.

A couple of issues that I ran into:

1. The description of course picks up all kinds of html code, line breaks, images, etc. if they are in the first 140 characters.

My fix was to replace the description with the title followed by a generic blurp.

2. The header-insert function (in the admin panel) replaces the changes in showflat.php and showthreaded.php

I looked for a way to prevent the showflat.php and showthreaded.php ONLY from using the header-insert but that got a bit to complex for a newbie.

Any ideas?

neuron #225044 10/19/2002 12:57 PM
Joined: Sep 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Sep 2002
Posts: 10
Hi Dave

I had to remove the shwoflat.php modification. There's a glitch.

A link pointing to a multi-page thread from the past 24-hour view would not show the amount of pages or the post. You had to get there through the Main Index...

Fred

matej #225045 10/19/2002 2:44 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I'm assuming these issues are addressed to JustDave, not me.

matej #225046 10/19/2002 5:44 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'm not sure what this modification would have in common with the "view messages - 24 hours, 48 hours and 7 days" so I am not sure what the problem could have been. This mod doesn't affect the posts in any way actually. It simply adds some meta tags to the <head>...



Edit note: after thinking about it perhaps it was some HTML in the meta tag that was causing the problems. You would probably need to remove html formatting before inserting anything into the tags.

Last edited by JustDave; 10/19/2002 5:46 PM.
sjsaunders #225047 11/09/2002 6:35 PM
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
Similar problem about the multi pages not showing up?

I don't allow HTML on the board, just UBB code. I'm thinking that the descrip and keywords are being developed on the fly? I have added the code as defined in this thread to my 6.1.1 UBB Threads.

Any ideas?


alsalmicom #225048 11/09/2002 6:46 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Perhaps it's HTML showing up in the meta tags that is throwing things off. I'll try installing this on my test site and see if I can find what is actually going wrong.

sjsaunders #225049 11/10/2002 11:08 PM
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
There was a line in the original Showfalt.php file that seems to have been overlooked. At first I deleted it with the the rest of that section. Then I left it in. No luck either way.

What follows is from the original portion of the Showflat file:
$query = "
SELECT B_Replies,B_Counter,B_Last_Post,B_Subject,B_Rating,B_Rates,B_RealRating
FROM {$config['tbprefix']}Posts
WHERE B_Number = '$current'
";
$sth = $dbh -> do_query($query);
list($checkreplies,$count,$posted,$tsubject,$Rating,$Rates,$stars) = $dbh -> fetch_array($sth);
$length = $checkreplies + 1;

Note the last line. This last line was not mentioned in the instructions for this hack. I'm not sure if it was an oversite or not, but I thought I'de bring it to your attention.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)