News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

vBulletin Style Meta Tags

Started by rsw686, March 23, 2008, 09:36:45 PM

Previous topic - Next topic

Chadrew

#60
Thank you very much rsw686 for writing this plugin, and SONSiVRi for porting it to 1.1.5. You guys rock!  :D This is by far the best meta tag plugin for SMF that I've seen.

By the way, I'd like to remove the bold part in message index tags:

QuoteBoard, Name, Board Name, your keywords

So I went to MetaTags.php and changed this:

function MetaTagsGenerateKeywords ($text)
{
$common_words = array('a', 'and', '&', 'at', 'as', 'for', 'it', 'in', 'of', 'on', 'or', 'quot', 'the', 'to', 'ir', 'bet', 'ne', 'taip');

$text = MetaTagsSpecialChars(str_replace(',', '', $text));

// Build array of the keywords without punctuation.
preg_match_all('/\w+/', $text, $keywords);

// Only one keyword, just return.
if(count($keywords[0]) == 1)
return $text;

// Remove any common words.
$i=0;
foreach($keywords[0] as $word)
{
if(in_array($word, $common_words))
unset($keywords[0][$i]);
$i++;
}

// Return the individual keywords along with the keyword string.
return implode(', ', $keywords[0]) . ', ' . $text;
}

To this:

function MetaTagsGenerateKeywords ($text)
{
$text = MetaTagsSpecialChars(str_replace(',', '', $text));
// Build array of the keywords without punctuation.
preg_match_all('/\w+/', $text, $keywords);
// Return the individual keywords along with the keyword string.
return $text;
}


I'm a php noob - everything seems to be working, but didn't I delete something needed?  :-\

SONSiVRi

This function (MetaTagsGenerateKeywords) is used in message index and message display keyword generations. So you are blocking message display as well as message index. Code side is ok.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Bancherd

This is a great mod, and I used a version for 1.1.6(that someone posted) on my live board.

Any news on update for smf2beta4public ?

EdwinK

@bancherd: Any change of you posting that 1.1.6 version?
|| foto-site ||

SONSiVRi

Quote from: EdwinK on September 11, 2008, 12:41:19 PM
@bancherd: Any change of you posting that 1.1.6 version?

Its located on second page, I ported it.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

brandonroy

I REALLY need this mod. I'm running SMF 1.1.6 and installed SONSiVRi's modified version, but there was an error in the installation for /Themes/default/index.template.php

I do not and have never had the easy edit meta mod installed on my forum.

Can I get some help?

SONSiVRi

Quote from: brandonroy on September 12, 2008, 04:27:54 AM
I REALLY need this mod. I'm running SMF 1.1.6 and installed SONSiVRi's modified version, but there was an error in the installation for /Themes/default/index.template.php

I do not and have never had the easy edit meta mod installed on my forum.

Can I get some help?

I could help but I need your current code.
Paste your codes between line numbers 60 and 80 in /Themes/default/index.template.php.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

brandonroy

Quote from: SONSiVRi on September 12, 2008, 05:52:24 AMI could help but I need your current code.
Paste your codes between line numbers 60 and 80 in /Themes/default/index.template.php.

Here is the code from lines 60 - 80:


function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', !empty($context['meta_description']) ? $context['meta_description'] : $modSettings['meta_description'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '
<meta name="keywords" content="', !empty($context['meta_keywords']) ? $context['meta_keywords'] . ', ' : '', $modSettings['meta_keywords'], '" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";
// ]]></script>
<title>', $context['page_title'], '</title>';

SONSiVRi

brandonroy
Everything seems fine in index.template.php, required modifications were made as should be. It seems you tried the install this mod twice.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

brandonroy

Quote from: SONSiVRi on September 13, 2008, 04:52:04 AM
brandonroy
Everything seems fine in index.template.php, required modifications were made as should be. It seems you tried the install this mod twice.

Well I uninstalled it after it said not to go ahead with the install because of the installation error. So what should I do? Try to install it again?

SONSiVRi

Quote from: brandonroy on September 13, 2008, 06:04:21 AM
Quote from: SONSiVRi on September 13, 2008, 04:52:04 AM
brandonroy
Everything seems fine in index.template.php, required modifications were made as should be. It seems you tried the install this mod twice.

Well I uninstalled it after it said not to go ahead with the install because of the installation error. So what should I do? Try to install it again?

Use the mod parser (http://www.adrevenueshare.com/parser) and check those moddifications are present on your files.
There is not much changings (5 or 6), just check each modification and be sure search condition are present.
If its not (like index.template.php), then search replaced text and make it original (mod file contains it) back.
I can be more specific if you cant handle.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

brandonroy

#71
Quote from: SONSiVRi on September 13, 2008, 04:49:16 PM
Quote from: brandonroy on September 13, 2008, 06:04:21 AM
Quote from: SONSiVRi on September 13, 2008, 04:52:04 AM
brandonroy
Everything seems fine in index.template.php, required modifications were made as should be. It seems you tried the install this mod twice.

Well I uninstalled it after it said not to go ahead with the install because of the installation error. So what should I do? Try to install it again?

Use the mod parser (http://www.adrevenueshare.com/parser) and check those moddifications are present on your files.
There is not much changings (5 or 6), just check each modification and be sure search condition are present.
If its not (like index.template.php), then search replaced text and make it original (mod file contains it) back.
I can be more specific if you cant handle.

Awesome. I got it installed with no errors.
I had to make an edit on my custom theme. Now I'm trying to figure out what to do to make the meta description and meta keywords. I also don't want my forum name in the title of my forums. only on the homepage

EDIT: Ah, the options were hidden under basic features! Now I'm just working on taking the forum name out of all the boards except the homepage.

EDIT 2: All set and good to go. Thanks SONSiVRi for modding this mod! :)

SONSiVRi

My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Smitten

#73
I have this problem.

Please help me. It seems serious. Need the database an upgrade? How do i this?

SONSiVRi

It seems something wrong with your mod installation, the error happens if you dont have correct tables on your database.
But in our case its can't be, cause those are smf's tables already there.
I dunno how this problem solved, but you may check the mod installation of manual way.
Use this parser http://www.adrevenueshare.com/parser and make sure all modifications are done.
Btw I am talking about 1.1.6, if you are using 2.0 I dont know about it.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

rsw686

The issue is the mod was designed for 2.0 and will not work with 1.1.x.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

SONSiVRi

Quote from: rsw686 on September 18, 2008, 12:08:02 PM
The issue is the mod was designed for 2.0 and will not work with 1.1.x.

Why it cannot work on 1.1.x versions?
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

rsw686

Quote from: SONSiVRi on September 18, 2008, 02:49:20 PM
Quote from: rsw686 on September 18, 2008, 12:08:02 PM
The issue is the mod was designed for 2.0 and will not work with 1.1.x.

Why it cannot work on 1.1.x versions?

The way the database queries are made and the field names changed. Feel free to modify it to work with 1.1.x. All my mods were written specifically for my site. I am trying to give back to the community by sharing them. My time is limited so I really don't have the time to add features, make them work for other versions, etc.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

SONSiVRi

ohh I was thinking about some special things exist and doesnt fit on 1.1.x versions. Cuz I already ported your mod into 1.1.x versions and its working couple of months. members used the ported version are says its well working also.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Bancherd

Quote from: SONSiVRi on September 18, 2008, 09:41:16 PM
ohh I was thinking about some special things exist and doesnt fit on 1.1.x versions. Cuz I already ported your mod into 1.1.x versions and its working couple of months. members used the ported version are says its well working also.

Yes, I am using the ported version on my live forum for many months without any problems.

I will certainly use the SMF2 version.  Is it compatible with smf2beta4public?  It is a VERY GOOD mod, thank you for sharing it.

Advertisement: