vBulletin Style Meta Tags

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

Previous topic - Next topic

rsw686

Quote from: Bancherd on September 19, 2008, 01:07:40 AM
I will certainly use the SMF2 version.  Is it compatible with smf2beta4public?  It is a VERY GOOD mod, thank you for sharing it.

If is compatible with 2.0 Beta 4, however you will need to manually modify your index.template.php file. Due to the theme changes it doesn't automatically apply. Although it is a quick fix.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Bancherd

Quote from: rsw686 on September 19, 2008, 08:47:25 PM
Quote from: Bancherd on September 19, 2008, 01:07:40 AM
I will certainly use the SMF2 version.  Is it compatible with smf2beta4public?  It is a VERY GOOD mod, thank you for sharing it.

If is compatible with 2.0 Beta 4, however you will need to manually modify your index.template.php file. Due to the theme changes it doesn't automatically apply. Although it is a quick fix.

Thanks. :)

ryozo

thanks for 1.1.X
it installed perfectly on 1.1.6

argimiro

#83
many thanks rsw686 & thanks SONSiVRi for the port

installs & works well, both the original on SMF 2.0 beta 4 & the ported version on 1.1.6 here 



For those using Ericsworld's E-Arcade mod, I noticed that this mod doesn't know about the arcade, so description and keywords are not altered on the play screens for each game

more accurately it's the arcade that doesn't know about the mod..

To rectify this is fairly simple:

Open up /Sources/ArcadePlay.php

Inside you will find function ArcadePlay()

Somewhere inside that function, include code to generate your arcade description and arcade keywords.

I added my code right below the following E-Arcade code:


// Generate html-code for game
if ($game['gameType'] == 0)
$context['arcade']['game']['html'] = ArcadeFlashHtml($game, true, $message);


My simple 'hardcoded' test example was to simply add:


$context['meta_keywords']          = "keywords, inside, arcade, play, screen";
$context['meta_description']        = "Arcade play screen with modified meta info";


You can make the code as complicated as you want to generate whatever meta strings required, so long as those strings end up in the $context array as above. If those 2 meta_* variables above are present & set, they will be echoed out.

I ended up with the full code:


// Generate html-code for game
if ($game['gameType'] == 0)
$context['arcade']['game']['html'] = ArcadeFlashHtml($game, true, $message);

// meta description and keywords for the arcade game play screens
$context['meta_keywords'] = $game['name'];
$context['meta_description'] = "Play " . $game['name'] . " at " . $context['forum_name'];


I guess a similar approach would work for other areas of the arcade such as games list / category screens etc; just edit the relevant arcade functions inside the relevant arcade /Sources/ files.

This 'mod of a mod' was tried on 1.1.6 - haven't tried it on smf 2.0 but something similar should be possible


Not too sure if the place where I've put the code, might mean my code would only work for flash games.. should be okay with a blank line in there to keep it away from that if-statement but somebody better at coding might want to comment on that. I only know odds and ends of php 




----------



for arcade category listing pages, could try something like the following at the very bottom of function ArcadeList() in file Sources/ArcadeList.php:

replace the very last line of the function:


$context['page_title'] = $txt['arcade_game_list'];


with code something like:


if  (isset($category))

    {

    $catname_fortags = db_query("
SELECT catName
FROM {$db_prefix}arcade_categories
WHERE ID_CAT=$category", __FILE__, __LINE__);

    $catname_fortags_fetched_array = mysql_fetch_assoc($catname_fortags);
    $catname_fortags_fetched = preg_replace("/[^a-z0-9]/i", " ", $catname_fortags_fetched_array['catName']);
    $context['page_title'] = $context['forum_name'] . " flash games arcade: " . $catname_fortags_fetched . " category";
    $context['meta_description'] = "Flash games category: " . $catname_fortags_fetched . " at " . $context['forum_name'];
    $context['meta_keywords'] = $catname_fortags_fetched;

    }

    else

    {

    $context['page_title'] = $txt['arcade_game_list'];

    }


I know, that doesn't use the language system properly & it's probably buggy as hell to boot as-is, just posting it as 'demo'.

there should probably be a few mysql_free_result()'s in there somewhere

Frozt

For install in SMF 2.0 Beta 4 I have this in index.template.php:

<meta name="description" content="', $context['page_title_html_safe'], '" />
<meta name="keywords" content="', $context['meta_keywords'], '" />


instead the lines that have to find the mod for install:


<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />


its correct if I change that lines for or need to modify it to the version 2.0 Beta 4?:


<meta name="description" content="', !empty($context['meta_description']) ? $context['meta_description'] : $modSettings['meta_description'], '" />
<meta name="keywords" content="', !empty($context['meta_keywords']) ? $context['meta_keywords'] . ', ' : '', $modSettings['meta_keywords'], '" />



is the only file that fail in the installation

Hoochie Coochie Man

Thank you very much for this beautiful mod @rsw686
and thank you very much for converting @SONSiVRi
it is working :)
İnadına SMF 1.1.X

CraigPal

There doesn't seem to be an uninstaller with the 1.x hack. Will this present a problem when trying to upgrade to 2.0?

________________
Raw Paleolithic Diet

SONSiVRi

Quote from: CraigPal on October 24, 2008, 01:56:04 AM
There doesn't seem to be an uninstaller with the 1.x hack. Will this present a problem when trying to upgrade to 2.0?

I didnt try uninstaller but I dont think there will be problem while uninstalling.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

worker

hi i want to install your mod on my smf 1.1.6 version is it posible and if it is ple explain how :)
thx.


nay27uk

the installer trows up an eror for ManageSettings.php not found, i dont have a ManageSettings.php
i redownloaded a new compleate zip of SMF 1.1.7 just to sheck and its not in the original SMF package either.
What should i do

rsw686

Quote from: nay27uk on November 18, 2008, 07:52:00 AM
the installer trows up an eror for ManageSettings.php not found, i dont have a ManageSettings.php
i redownloaded a new compleate zip of SMF 1.1.7 just to sheck and its not in the original SMF package either.
What should i do

Read the above posts for more information.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

ivo2296

Does the mod reverse the modified database when uninstalled?

rsw686

Quote from: ivo2296 on December 08, 2008, 02:02:52 PM
Does the mod reverse the modified database when uninstalled?

No but you can remove the two values (meta_description, meta_keywords) manually from the settings table. It leaves these values so you don't have to re-enter the data when upgrading.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

ivo2296

Quote from: rsw686 on December 08, 2008, 07:40:32 PM
Quote from: ivo2296 on December 08, 2008, 02:02:52 PM
Does the mod reverse the modified database when uninstalled?

No but you can remove the two values (meta_description, meta_keywords) manually from the settings table. It leaves these values so you don't have to re-enter the data when upgrading.

Thanks!!!

question

for version 1.1.7 the mod's mod by SONSiVRi
won't work .

when i clicked on a topic it has displayed a message that i have a 1.1.6 sql structure while the software is 1.1.7 and i need to update sql to fix it .

while the sql is the sql of the 1.1.7 version but was modified by the dbmodify.php file ,

i would really want to install this mod or at least do changes that allow the script to do what it does.

can anyone help me with the 1.1.7 installation
or
at least tell me how to get the mod's result.. using  manual editing  .

thanks for the help guys  ;D
website :)

question

website :)

SONSiVRi

Quote from: question on December 21, 2008, 05:00:32 PM
any help please ?
For the record its not my mod, I only ported it.
Give here your screenshot of error (while topic display), and also copy from error description in "error log" too.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

question

Quote from: SONSiVRi on December 22, 2008, 02:13:14 PM
For the record its not my mod, I only ported it.

i know i have read all the topic all the 5 pages trying to find a solution :)
thank you for porting it .

here's the errors i get , including the error log

errors occur when :
a- click on category:

Fatal error: require_once() [function.require]: Failed opening required '/MetaTags.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/site/forum/Sources/MessageIndex.php on line 163

b- click on topic:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 4
File: /home/user/public_html/site/forum/Sources/MetaTags.php
Line: 45

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.7, while your database is at version 1.1.6. The above error might possibly go away if you execute the latest version of upgrade.php.


error log:

2: require_once(/MetaTags.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory
File: /home/user/public_html/site/forum/Sources/MessageIndex.php
Line: 163

website :)

question

website :)

Advertisement: