xoops forums

Forum Index


Board index » All Posts




Anonymous

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

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>


ZPC

Official Support Member
Posted on: 2002/2/20 19:01
ZPC
ZPC (Show more)
Official Support Member
Posts: 76
Since: 2002/1/16
#292242

Re: This page loaded in x seconds

yes..it's not about the transfer of the page from the server to your browser, it's the time that took the server to parse all the php and sql command and print-out the output...

the time depends on things like server hardware (CPU, memory), operating system, apache+php+sql setup etc...


nocjock

Just popping in
Posted on: 2002/2/20 18:49
nocjock
nocjock (Show more)
Just popping in
Posts: 19
Since: 2002/1/3 1
#292243

Re: This page loaded in x seconds

What kind of times are you all coming up with? Mine are always less than 1 second. This must be an internal server calculation, not necessarily time for actual page display, which is misleading to someone looking for response times to display, unless you work in the marketing department.


AndyC

Just popping in
Posted on: 2002/2/20 17:59
AndyC
AndyC (Show more)
Just popping in
Posts: 16
Since: 2002/1/10
#292244

Re: This page loaded in x seconds

My Bad...

It works now. Thanks.


ZPC

Official Support Member
Posted on: 2002/2/20 17:47
ZPC
ZPC (Show more)
Official Support Member
Posts: 76
Since: 2002/1/16
#292245

Re: This page loaded in x seconds

are you sure, that you uncommented the line in header.php ??? it's the first line of the real code (below the standard file header)...


AndyC

Just popping in
Posted on: 2002/2/20 17:34
AndyC
AndyC (Show more)
Just popping in
Posts: 16
Since: 2002/1/10
#292246

Re: This page loaded in x seconds

it always takes 0 seconds on my site.


ZPC

Official Support Member
Posted on: 2002/2/20 16:37
ZPC
ZPC (Show more)
Official Support Member
Posts: 76
Since: 2002/1/16
#292247

Re: This page loaded in x seconds

yeah...the function is hidden in include/functions.php (line 589) and as well as in footer.php it has to be uncommented in header.php which are both in root directory.

Then you will se what it takes to produce one page.

I would like to point out, that this text is not translated in regular language files !!!



lykoszine

Module Developer
Posted on: 2002/2/20 14:36
lykoszine
lykoszine (Show more)
Module Developer
Posts: 244
Since: 2002/1/2 2
#292248

Re: This page loaded in x seconds

The code you mentioned is in footer.php, around line 40 I think... It just needs uncommenting...

I have no idea how it is set up though, whether it is initialised in the header or what...

Does give me a general idea though...




Amgine

Just popping in
Posted on: 2002/2/20 4:26
Amgine
Amgine (Show more)
Just popping in
Posts: 3
Since: 2002/1/5 1
#292249

Re: This page loaded in x seconds

This would need ss_timing_start() earlier - like in the header, or even in a script that was called earliest - before db queries etc.

And you would have to find the actual functions - I am not sure that these are PHP 'builtins'.

But it is a start - and the sort of thing embedded in XOOPS for debugging, as I referred to earlier.


bob

Just popping in
Posted on: 2002/2/20 1:46
bob
bob (Show more)
Just popping in
Posts: 8
Since: 2002/1/9 1
#292250

Re: This page loaded in x seconds

here's the little script in the footer of many myphpnuke sites. i'm just a crude hacker, not a php programmer, so I can't tell if this gives you enough to work with...

echo "<center><font size=1>\n";
ss_timing_stop();
$help = sprintf(translate("Page took %s seconds to load."),ss_timing_current());
echo "$help";
echo "</font></center>\n";
echo "<br>\n";