Best of joomla gives you news, joomla templates, tutorials and websites about Joomla , FireBoard and FireMessage official page.
| No account yet?   |
Welcome, Guest
Please Login or Register.    Lost Password?
FireBoard Manual Latest release discussions Download FireBoard Spread FireBoard!
Re:SEO for fireboard still not answered (1 viewing) (1) Guest
Go to bottom Favoured: 5
TOPIC: Re:SEO for fireboard still not answered
#32506
SEO for fireboard answered 12 Months ago  
Here's a step-by-step solution for dynamic meta tags inside each thread:

1. open /template/default/view.php
2. anywhere after ' if ($badwords == "true" {}' paste:

[code:1]if (!$fmessage->parent) {
$metapost = preg_replace("/[^a-z .A-Z0-9s]/", "",
strip_tags(substr($fmessage->message,0,400)));
$metasubj = preg_replace("/[^a-z .A-Z0-9s]/", "", $fmessage->subject);
$metadesc = $metasubj . ' - ' . $metapost;

$mainframe->addMetaTag( 'description' , $metadesc );

$keyarray = explode (' ' , $metasubj . ' ' . $metapost);
$search_ignore = array();
@include "$mosConfig_absolute_path/language/$mosConfig_lang.ignore.php";

foreach ($keyarray as $keytest) {
$keytest = str_replace('.' , '', strtolower(trim($keytest)));

if ($keytest && !in_array( $keytest, $search_ignore ))
$metakey .= $keytest . ', ';
}
if ($metakey)
$mainframe->addMetaTag( 'keywords' , substr ($metakey, 0, -2));
}[/code:1]

3. To remove the generic Joomla meta-tags from appearing after the dynamic tags, enter /includes/joomla.php, find and comment out the existing function appendMetaTag() and paste the code inside the Meta Tags Mod zipped attachment. (Bb-code chews it up if I paste it here.)

4. To improve keyword filtering, replace the existing /languages/english.ignore.php with the version I posted further down in this thread. Note that this would also enable your default Joomla/Mambo search component to ignore a list of common English words.

Here's an example of a [url=http://www.gossper.com/component/option,com_fireboard/Itemid,26/func,view/id,253/catid,27/]thread[/url] on my site that uses this mod.

Comments and suggestions welcome!

Gom
[url=http://www.gossper.com/welcome]Gossper[/url] - The Last Social Forum [file name=Meta_Tags_Mod-f105129ed3a70433e5cc182132fec7bc.zip size=897]http://www.bestofjoomla.com/images/fbfiles/files/Meta_Tags_Mod-f105129ed3a70433e5cc182132fec7bc.zip[/file]
gomjabbar (User)
Senior Boarder
Posts: 112
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2007/11/28 20:26 By gomjabbar.
 
Gossper - One Forum to Rule Them All
 
The administrator has disabled public write access.  
#32527
Re:SEO for fireboard still not answered 12 Months ago  
Can you post some example of what this does for the metatags on your forum?
DCB (User)
Junior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#32539
Re:SEO for fireboard still not answered 12 Months ago  
To remove the generic Joomla meta-tags from any page that you've custom-tagged, you need to enter /includes/joomla.php, find and comment out the wonky existing function appendMetaTag() and paste:

[code:1]function appendMetaTag( $name, $content ) {
$name = trim( htmlspecialchars( $name ) );
$n = count( $this->_head['meta'] );
for ($i = 0; $i _head['meta'][$i][0] == $name) $exist = 1;
}
if (!$exist)
$this->addMetaTag( $name , $content );
}[/code:1]
gomjabbar (User)
Senior Boarder
Posts: 112
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2007/11/28 19:41 By gomjabbar.
 
Gossper - One Forum to Rule Them All
 
The administrator has disabled public write access.  
#32540
Re:SEO for fireboard still not answered 12 Months ago  
look forward to updates. Thanks for your time in helping with this. It really is a huge flaw in the forum component. Your work is truly appreciated.
DCB (User)
Junior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#32550
Re:SEO for fireboard still not answered 12 Months ago  
message removed
gomjabbar (User)
Senior Boarder
Posts: 112
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2007/11/28 19:42 By gomjabbar.
 
Gossper - One Forum to Rule Them All
 
The administrator has disabled public write access.  
#32554
Re:SEO for fireboard still not answered 12 Months ago  
Am I adding this correctly?

[code:1]foreach ($flat_messages as $fmessage)

{
if (!$fmessage->parent) {
$metapost = preg_replace("/[^a-z .A-Z0-9s]/", "", strip_tags(substr($fmessage->message,0,400)));
$metasubj = preg_replace("/[^a-z .A-Z0-9s]/", "", $fmessage->subject);
$metadesc = $metasubj . ' - ' . $metapost;

$mainframe->addMetaTag( 'description' , $metadesc );

$keyarray = explode (' ' , $metadesc);
$search_ignore = array();
@include "$mosConfig_absolute_path/language/$mosConfig_lang.ignore.php";

foreach ($keyarray as $keytest)
{
$keytest = str_replace('.' , '', trim($keytest));
if ($keytest && strlen( $keytest ) > 3 && !in_array( $keytest, $search_ignore ))
$metakey .= $keytest . ', ';
}
if ($metakey) $mainframe->addMetaTag( 'keywords' , substr ($metakey, 0, -2));
}

$k = 1 - $k;

$mmm++;



if ($fmessage->parent == 0) {

$fb_thread = $fmessage->id;

}

else {

$fb_thread = $fmessage->thread;

}

[/code:1]

That's the section you mentioned to add the code to, is that correct? It's giving me errors. What version of Fireboard are you using? Also I'm running SEFadvance, wonder if that is causing any problems? Just trying to narrow it down.
DCB (User)
Junior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#32557
Re:SEO for fireboard still not answered 12 Months ago  
Try to paste it after if ($badwords == "true" {}. That's where mine is. Maybe some other value needs to be populated first. Also, use this version (better):

if (!$fmessage->parent) {
$metapost = preg_replace("/[^a-z .A-Z0-9s]/", "", strip_tags(substr($fmessage->message,0,400)));
$metasubj = preg_replace("/[^a-z .A-Z0-9s]/", "", $fmessage->subject);
$metadesc = $metasubj . ' - ' . $metapost;

$mainframe->addMetaTag( 'description' , $metadesc );

$keyarray = explode (' ' , $metasubj . ' ' . $metapost);
$search_ignore = array();
@include "$mosConfig_absolute_path/language/$mosConfig_lang.ignore.php";

foreach ($keyarray as $keytest)
{
$keytest = str_replace('.' , '', strtolower(trim($keytest)));

if ($keytest && !in_array( $keytest, $search_ignore )) $metakey .= $keytest . ', ';
}
if ($metakey) $mainframe->addMetaTag( 'keywords' , substr ($metakey, 0, -2));
}
gomjabbar (User)
Senior Boarder
Posts: 112
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Gossper - One Forum to Rule Them All
 
The administrator has disabled public write access.  
#32559
Re:SEO for fireboard still not answered 12 Months ago  
Use this version of /language/english.ignore.php to filter out common English words from the meta keywords tag. Note that this is the file used by the Joomla search component, which I've co-opted for our devious purposes.

Gom
File Attachment:
File Name: english-cee39f641c9f3ce21a252aaa89f6324f.zip
File Size: 1034
gomjabbar (User)
Senior Boarder
Posts: 112
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Gossper - One Forum to Rule Them All
 
The administrator has disabled public write access.  
#32561
Re:SEO for fireboard still not answered 12 Months ago  
gomjabbar wrote:
Try to paste it after if ($badwords == "true" {}. That's where mine is. Maybe some other value needs to be populated first. Also, use this version (better):

if (!$fmessage->parent) {
$metapost = preg_replace("/[^a-z .A-Z0-9s]/", "", strip_tags(substr($fmessage->message,0,400)));
$metasubj = preg_replace("/[^a-z .A-Z0-9s]/", "", $fmessage->subject);
$metadesc = $metasubj . ' - ' . $metapost;

$mainframe->addMetaTag( 'description' , $metadesc );

$keyarray = explode (' ' , $metasubj . ' ' . $metapost);
$search_ignore = array();
@include "$mosConfig_absolute_path/language/$mosConfig_lang.ignore.php";

foreach ($keyarray as $keytest)
{
$keytest = str_replace('.' , '', strtolower(trim($keytest)));

if ($keytest && !in_array( $keytest, $search_ignore )) $metakey .= $keytest . ', ';
}
if ($metakey) $mainframe->addMetaTag( 'keywords' , substr ($metakey, 0, -2));
}


Nice, yes that seems to work swimmingly.
DCB (User)
Junior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#32562
Re:SEO for fireboard still not answered 12 Months ago  
Hey,

Sorry one more question. I attempted to add in the code you mentioned here:

1. open /includes/joomla.php

2. find and comment out the entire function appendMetaTag( $name, $content )

3. paste in this version:

function appendMetaTag( $name, $content ) {
$name = trim( htmlspecialchars( $name ) );
$n = count( $this->_head['meta'] );
for ($i = 0; $i _head['meta'][$i][0] == $name) $exist = 1;
}
if (!$exist)
$this->addMetaTag( $name , $content );
}

When I do that it renders a blank page though. Can you post the full code for that section? Perhaps I'm commenting out too much?
DCB (User)
Junior Boarder
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
Go to top