xoops forums

Anonymous

Posted on: 2002/2/27 10:17
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#1

Hacked the REF Hack :o)

Liked the idea of the ref hack to make the article into keywords for the meta tags, but hated the way it actually made the keywords... so i hacked it at my turn

No more words with more than 3chars, no more html entities in the keywords, and most importantly: no keyword doubles... and all keywords are made uppercase 1st letter

/* article page output */
global $bodytext;
$htmlless strip_tags($metatitle.",".$bodytext);
$search = array(
        
"/>/i",
        
"/</i",
        
"/&/i",
        
"/"/i",
        
"/'/i",
        
"/[^-w']/i",
        
"/s+/",
        
"/ (.{1,3}),/i",
        
"/(, )$/"
        
);
$replace = array(
        
">",
        
"<",
        
"&",
        
""",
        "'",
        " ",
        ", ",
        "",
        ""
        );
$metatags = preg_replace($search, $replace, $htmlless);
$metatags = explode(", ",$metatags);
$metatags = array_unique($metatags);
$metatags = implode(", ",$metatags);
echo "<meta http-equiv="keywords" content="".ucwords($metatags).""></meta>n";
}
else
{
echo "<meta name="keywords" content="".$meta.""></meta>n";
}
echo "<meta name="description" content="".$xoopsConfig['
slogan'].""></meta>n";
echo "<meta name="generator" content="".$xoopsConfig['
version'].""></meta>nnn";
echo "<meta http-equiv="Content-Type" content="text/html; charset="._CHARSET."" />n";
// Fin - Hack référencement


Feel free to integrate it into the actual ref hack

<small>[ Edited by Half-Dead on 2002/2/27 11:26:00 ]</small>

A-dog

Just popping in
Posted on: 2002/2/27 11:20
A-dog
A-dog (Show more)
Just popping in
Posts: 19
Since: 2002/1/25
#2

Re: Hacked the REF Hack :o)

really sweet. man thats nice. Just installed it. Thanks for the cleanup.
I really enjoyed playing with this one.. headers look great..the SE's will really do their jobs with these keywords...

linamix

Just popping in
Posted on: 2002/2/27 13:48
linamix
linamix (Show more)
Just popping in
Posts: 6
Since: 2002/1/8 8
#3

Re: Hacked the REF Hack :o)

Merci Half-Dead... Bien joué !

Vive XOOPS !!!

ZPC

Official Support Member
Posted on: 2002/2/27 13:53
ZPC
ZPC (Show more)
Official Support Member
Posts: 76
Since: 2002/1/16
#4

Re: Hacked the REF Hack :o)

I found some bugs, like deleting line breaks, deleting country specific characters etc.

I will try to create some addition soon.

Anonymous

Posted on: 2002/2/27 15:05
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#5

Re: Hacked the REF Hack :o)

Tnx all

BUT...Just hacked it up even more and exported all the settings to a config file: much easier to customize. hehe

See: here

If ya wanna fix it up, i'd do it from the version in the above link..much cleaner


---------
Line breaks aint a bug, since keywords shouldnt have any, but your right about the language characters: wasnt thinking about non english sites when i changed it

<small>[ Edited by Half-Dead on 2002/2/27 16:25:28 ]</small>

Anonymous

Posted on: 2002/2/27 21:31
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#6

Re: Hacked the REF Hack :o)

Just updated the hack again, and added the possibility to define unwanted words in the config file...very usefull to remove common crap

Repacked REF Hack

---
updated link

<small>[ Edited by Half-Dead on 2002/3/1 23:59:56 ]</small>

Anexia

Just popping in
Posted on: 2002/2/27 21:41
Anexia
Anexia (Show more)
Just popping in
Posts: 3
Since: 2002/2/22
#7

Re: Hacked the REF Hack :o)

Euh ! Linamix vu que tu parle français/anglais tu pourrais nous traduire ça sur le forum de XOOPS France avec le lien de la nouvelle version de Ref_hack !!!

Sorry ! My english is very bad.
I read english.... but, not speak or write...

<small>[ Edited by Anexia on 2002/2/28 7:36:54 ]</small>

Anonymous

Posted on: 2002/2/28 11:06
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#8

Re: Hacked the REF Hack :o)

Damn! I gotta stop playing with this hack :o)

Just added the possibility to make tags from any section of the site: forum, downloads, links, faq..

It'll be on the main XOOPS news page soon, so stay tuned

Rincewind

Just popping in
Posted on: 2002/2/28 12:11
Rincewind
Rincewind (Show more)
Just popping in
Posts: 16
Since: 2002/1/14
#9

Re: Hacked the REF Hack :o)

This is a very usefull hack. However there is a few more feature I would find usefull.

You script cuts out short words like "the" "and" "to" but many words in english are longer than three letters but should also be cut out such as "from", "because", "also", and others. Would it be posible to create a data file of words to exclude. Or crossreferance the keywords with a dictionary file and only include nouns and verbs. Thus excluding all proverbs. I understand this is a bit more than just a hack and could be a leanthy mod. Plus it would have to be upadted with each fresh language supported. However it could be significanly benificial.

Sencondly: Would it be posible for someone out there to create a module that parsed the text on your pages a came back with a word count on each keyword used. This would be usefull to determine how well the search engines may rank you in thier listings. You would be able to alter the keyword density of your documents to optomise your ranking without the overkill of spamming keywords on pages, or the underkill of not enough keywords. I have found problems in underkill before. I once had a web design company site which ranked better under aromatherapy than under web design. This was because one of the clients was an alternative medicine group and so lots of my pages were discussing the clients site and not mine. Indeed at one point my web design site ranked higher for aroatherapy that the aromatherapy site itself. A mod like that discribed above would help predict how search engines will rank your pages before you submit them so you can correct things before it's to late. It's hard enough getting listed in search engines without worrying about listing incorectly.

Anonymous

Posted on: 2002/2/28 14:04
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#10

Re: Hacked the REF Hack :o)

Seems like they takin a bit time with the news :o)

REF Hack v4.1

Already has a wordlist(currently bout 70words big)... and it also does links, downloads, faq, & forum, in addition to the original articles

---
updated link

<small>[ Edited by Half-Dead on 2002/3/1 23:59:00 ]</small>