2 jibberjab Nov 21, 2005 23:47
![](https://forums.b2evolution.net/media/users/jibberjab/profile_pictures/.evocache/12555074666175daf0a7.jpg/crop-top-80x80.jpg?mtime=1372015408)
jibberjab wrote:
How about something like this for the toolbar, in /plugins/toolbars/_quicktags.toolbar.php, which would add a new button labeled 'SEO'?
That's an idea. I must say since I implemented [url=http://www.fckeditor.net/]FCKeditor[/url] as posts' text editor, I removed the Quick Tags toolbar...
According to my site's [url=http://www.xiti.com]Xiti[/url] traffic analysis, my blog's traffic coming from search engines increased by 80 to 110% since before implementing this hack.
Figures from 11/24/2005 compared to those from 11/17 (the day I implemented the hack on my site):
Direct access: +55.3% ("natural" increase);[*]Search engine: +106.4%;[*]External links: 9.7% ("natural" referrers).[/list:u]
Hi all and thanks for the hack. Fabolous.
It's important to format the output, otherwise it's not xhtml-valid anymore when using " for example.
Just modify the 'echo' parts like this:
// Found post-specific description, display it
echo( format_to_output( $Matches[ 4 ], 'htmlattr' ) );
And:
// Found post-specific keywords
// Display them
echo( format_to_output( $Matches[ 2 ], 'htmlattr' ) );
This is a core function provided by b2evo and used everywhere in the system.
Works fine at [url=http://www.manuel-breitfeld.de]my playground[/url]. ;)
I have now added a button in the backend to call a file which generates the meta-tags "description"/"keys" and then appends them with <!--description/keywords --> automatically to the textfield.
Some word's aren't keywords, so I have a blacklist. This blacklist is called keywords_bad.txt and is currently filled with german words. So if you're english, please feel free to create your own list with words. They have to be separated by a line break.
/* -------------------------------------------------------------------- */
/* :: Important :: */
/* -------------------------------------------------------------------- */
You have to use the "SEO Keywords & Description Hack" by kwa.
Otherwise b2evo won't be able to create meta-sags, so the meta-tag
generator would be useless.
Please do install the hack - it's easy!
Get it: http://forums.b2evolution.net/viewtopic.php?t=6129
/* -------------------------------------------------------------------- */
/* :: Installation :: */
/* -------------------------------------------------------------------- */
1. Unpack [url=http://www.manuel-breitfeld.de/media/metatag_generator_b2evolution.zip]this zip-file[/url] and copy the folder named
'metataggenerator' into the following directory:
plugins/
So afterwards it should look like that on your server:
plugins/metataggenerator/
- keywords_bad.txt
- metatag_generator.php
- readme_deutsch.txt
- readme_english.txt
2. Brwose to directory 'admin/' and open the file _edit_form.php.
Please do make a backup of this file before!
On line 195 you have the following code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if( $current_User->check_perm( 'upload' ) )
{ // ------------------------------- UPLOAD ---------------------------------- ?>
<input type="button" value="<?php echo T_('Upload a file/image') ?>"
onclick="launchupload();" tabindex="12" />
<?php
}
?>
</div>
Replace that by this one:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if( $current_User->check_perm( 'upload' ) )
{ // ------------------------------- UPLOAD ---------------------------------- ?>
<input type="button" value="<?php echo T_('Upload a file/image') ?>"
onclick="launchupload();" tabindex="12" />
<?php
}
?>
<input type="button" class="button" value="Generate meta-tags" onclick="window.open('<?php
echo $baseurl . '/' . $plugins_subdir . '/metataggenerator/metatag_generator.php?integrated';
?>', 'MetaTagGen', 'width=10, height=10'); self.focus();" name="MetaTagGen" />
</div>
Now save the file and this "installation" is finshed. ;)
/* -------------------------------------------------------------------- */
/* :: How to work with :: */
/* -------------------------------------------------------------------- */
1. When editing or writing a post you can now find a new button beside
Save/Preview called "Generate meta-tags".
By pressing the button, the script will automatically append the meta-
tags with <!-- --> into the textfield.
2. Useless words such as "you", "and", "me", "than" have nothing to do
with keywords. So we have to kill them.
All words which sould be ignored when generating the keywords-list
can be added to the list keywords_bad.txt.
Please feel free to do so!
Download the archive including all needed files:
http://www.manuel-breitfeld.de/media/metatag_generator_b2evolution.zip
The archive contains a english and german readme file. Germans can also look up [url=http://www.manuel-breitfeld.de/home.php/2006/01/13/meta_tag_generator_fur_b2evolution]the post in my personal blog[/url].
kwa wrote:
What is SEO Keywords & Description Hack?
Implementation
If you haven't created one before, create an empty conf/hacks.php and and edit it with the following code:
All the additional code should be copied between the above tags. Edit your conf/hacks.php file and add the following lines at the end of it: [/quote] I already have a conf/hacks.php file. I'm not sure what it does. Is there another way to implement this? J<?php ?>
had evers on line 63...When I added the meta codes it took me to a blank page...please help
guchuj05 wrote:
kwa wrote:
All the additional code should be copied between the above tags.
I already have a conf/hacks.php file. I'm not sure what it does. Is there another way to implement this?
There is no other "official" way to implement the hack otherwise than following the above instructions.
Since you have a conf/hacks.php, guess what you have to do? Follow the above instructions! And what are they? I'm going to repeat them again:kwa wrote:
All the additional code should be copied between the above tags.
What does that mean? That means this hack's code has to be copied somewhere between the beginning PHP tag:
<?php
and the ending one:
?>
That means you can insert the hack's code just after the beginning tag:
<?php
or just before the ending one:
?>
If you don't know PHP at all, dont try to put it anywhere else.
HOLOTTA.COM wrote:
had evers on line 63...When I added the meta codes it took me to a blank page...please help
Remove the meta codes and follow the right instructions again. If you mistype the meta codes, you're going to have a blank page again. In fact, do not type anything, use your browser's copy feature and your HTML source code editor's paste feature.
I love this hack, and it worked great on my blog when it was on 0.9.2, but now when I try to carry it over into 1.8, permalink pages come up blank.
Maybe there are just some variables with different names now? Any chance someone could post an updated version?
I'd love to see an upgrade for B2 Evo 1.8 of this plugin, too!
I fooled around a bit with the source but couldnt get the hack working with 1.8.2 :(
So kwa, please update your code ! ,-)
Manuel already updated his metatag generator to run with 1.8.2 but this only works with the seo hack....
Thx a lot !
Cheers,
Joshua
Any chance I can get the manuel hack? Its a 404 not found and I dont use 1.8
@mikkyT:
As all mails I sent you were dropped by your mailserver I just post the zip with the metatag generator here. Hope someone will find this useful ,-)
There are serveral changes to be done to get it running with version 1.8.x, I will write a little tutorial but first have to find Manuels mails in which he describes the changes.
Does anyone have any updates on this hack? I would like to implement on 1.8.5/1.8.6????
Thanks!
How to use this hack?
<!--description My nice post-specific description.-->
Other tags are also supported for your convenience (including meta_description, see source code for details).
I installed/implemented the hack but I have quite a trouble with figuring out on how to "add the following tag into your post's (X)HTML source code".
How do I get to see or display or access the post's (X)HTML source code?
Where is it in the admin?
Please help as I am stuck on this for more than 2 hours now.
Thanks a lot,
Stanofany chance some one could show how to apply this hack to 1.9.2?
I gave it a good try, but was stuck on the get_item_by_id and get_by_title functions in the hack.php
Please?
There used to be a plugin on the thread I linked, but I appear to have removed the file. When I get a moment I'll re-attach it
¥
that would be great -- thanks! I am alternatively playing with adapting the technorati plugin...
Hi ¥åßßå,
you seem like a guy that knows a lot about this plug in.
I have a question in the thread above but here is the short version of it:
I installed/implemented the hack but I have quite a trouble with figuring out on how to add the keywords code tag into my post's (X)HTML source code.
How do I get to see or display or access the post's (X)HTML source code?
Where is it in the admin?
The guy that created this topic talks about how to instal it and what to type into the (X)HTML source code of your post. But I can't figure out how to display/alter the post's HTML code.
How do you getting displayed in the admin?
Thanks a lot,
Stanof
This is a renderer type hack/plugin wich means you type one thing and it gets changed to XHTML. In this case kwa describes you should type into your post
<!--description
here comes your description
-->
so by starting with "<!--description" the renderer will know what's going on and will change the part after that.
XHTML is not visible in the backoffice. Just create your post and view the source of the blog afterwards.
Thanks a lot man, but I tried that and it didn't get parsed. I view the source of the post page I created and nothing there. I see exactly what I typed in in the blog's admin.
May it be that the plug in is no installed correctly then?
Is that why it's not parsing?
Thanks,
Stanof
Try the link mentioned before http://forums.b2evolution.net/viewtopic.php?t=9349&highlight= with more information. I am not sure wether the plugin works for 1.8.x and upwards. I have 1.9.2 and didn't get it to work so I'll wait till further notice from the developers.
General plugin knowledge: yes, you shuold unzip any plugin. With the newer pulgin you copy the complete folder to the ../blogs/plugins/ folder. With older plugins there will not be a folder but one or two files. These go in the same ../blogs/plugins/ folder.
In the backoffice a sucessfully copied plugin will show up under tools ->plugins. Some plugins need or want additional setup or toggle on/off. There should be a manual type of file accompanying the plugin.
Good luck
I've added a link to the plugin on [url=http://forums.b2evolution.net/viewtopic.php?p=44310#44310]this post[/url].
¥
That was very informative post@kwa
Thanks for sharing SEO Keywords & Description and how to hack them
3.3 now has fields for meta description and meta tags for each post.
Thanks a lot man, but I tried that and it didn't get parsed. I view the source of the post page I created and nothing there. I see exactly what I typed in in the blog's admin.
May it be that the plug in is no installed correctly then?
Introduced to [url=http://www.simplyearplugs.co.uk/sleeping-and-snoring-1.html]sleeping ear plugs[/url]
How about something like this for the toolbar, in /plugins/toolbars/_quicktags.toolbar.php, which would add a new button labeled 'SEO'?
This example drops both blocks into the post at once with no need for a closing tag.
There have always been line-wrapping issues with script blocks in the _quicktags.toolbar.php file, especially when copying a sample block from a forum post, so the best/safest option might be to just open the file and copy an existing block to maintain the line-wraps in your particular editor, then replace the content of your copied block with the info from this one... Maybe?
Anyway, this block should just dump the pre-formatted starting and ending tags into the post when you press the 'SEO' button, and then you replace the CAPITAL text with your own description and keywords.
I guess separate buttons could be made for the description 'DESC' and for keywords 'KEYW'... This example drops the opening section of the block into the post, you make your edits, then you hit the button again to close the tag block. It creates a separate button for "description" and for "keywords".
but some of us have already cluttered their admin toolbar buttons with other custom stuff and space can become an issue after a while so the single-button option might be desirable.
jj.