Jump to content


Last 10 Referers Snippet


  • You cannot reply to this topic
10 replies to this topic

#1 spear

    Etomite Forum Fan

  • Member
  • Pip
  • 61 posts

Posted 27 March 2006 - 01:32 PM

Thanks to Ralph we have the correct code. Find it bellow.

Edited by spear, 28 March 2006 - 06:19 PM.


#2 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 27 March 2006 - 02:56 PM

spear, on Mar 27 2006, 02:32 PM, said:

If I use this snippet outside etomite directory it work perfect, but inside etomite not work.

Please help
It won't work beacuse you are using echo to generate output, which isn't the way snippets work. Have you read the documentation, or looked at any snippets to see how they work?

#3 spear

    Etomite Forum Fan

  • Member
  • Pip
  • 61 posts

Posted 27 March 2006 - 05:45 PM

I didn't read the docs, Mike. If you can, help please. Many etomite users will be happy to use it.

#4 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 27 March 2006 - 06:40 PM

Ok, so your first port of call should be to read the docs, then attempt to create it... if you get stuck, then come back and ask for help

#5 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 27 March 2006 - 06:43 PM

Here are a few pointers regarding writing scripts within Etomite...\

1.) Whenever possible, take advantage of functions included in the Etomite API... This will not only serve to reduce the amount of code that you need to write but it will also allow such benefits as helpful debugging error code and "standardization"...

2.) Etomite scripts cannot include echo or print statements, nor any other unbuffered output functions... All outout must be concatenated onto an output variable, $output seems to be the standard, which is then returned to the caller for later insertion into the rendered page by the parser... Check existing snippets for more information on this method...

Example
$output = "";
$output .= "Etomite ";
$output .= "Rocks...!!!";
return $output;

3.) Pay close attention to the use of both globals and superglobals as due to the fact that Etomite is a parser engine some of the logic that may work in stand-alone PHP scripts will not work within Etomite...

4.) When in doubt, ask... :eto:

#6 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 27 March 2006 - 06:47 PM

spear, on Mar 27 2006, 06:45 PM, said:

I didn't read the docs, Mike. If you can, help please. Many etomite users will be happy to use it.
Well, please do read the documentation, that's what its there for!
Currently, the documentation is available in several formats from this forum thread
There is a section on writing snippets that would have told you not to use echo, and how to generate output.

#7 spear

    Etomite Forum Fan

  • Member
  • Pip
  • 61 posts

Posted 27 March 2006 - 08:43 PM

Dear friends. Already one hour I read the documentation, but I can't rewrite referers.php with etomite commands. Sorry, I am beginer.
Ok, forget this. If nobody need it, no problem.

#8 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 27 March 2006 - 11:13 PM

spear, on Mar 27 2006, 05:43 PM, said:

Dear friends. Already one hour I read the documentation, but I can't rewrite referers.php with etomite commands. Sorry, I am beginer.
Ok, forget this. If nobody need it, no problem.
What, exactly, are you attempting to do that demands our immediate attention...:?: How long have you been using Etomite...:?: How fast do you think you should be able to get up to speed on advanced programming practices with this code base...:?: Are you proficient with MySQL and the PHP programming language...:?: Don't come into these forums and get all huffy simply because someone doesn't hand out free code on demand... :!!: If you'd show a little more appreciation for what we do here by offering a Free CMS and Free support then maybe people will be more apt to help you learn...:!!: If you'd like to start over with a better attitude than you have presented thus far then maybe, just maybe, someone will try to help you in those brief moments when they aren't dealing with their own real-world every day lives... <_<


NUFF SAID... :eto:

#9 spear

    Etomite Forum Fan

  • Member
  • Pip
  • 61 posts

Posted 28 March 2006 - 08:05 AM

I am with etomite almost 6-8 months. I don't know php. This code above is written by a friend. Look arround in the net and you will not find nowhere for free "last 10 referers in main page" modul. He wrote it specialy for me and I decided to share it to etomite comunity. He is very busy person and I don't want to force him now to learn etomite comands and to rewrite this modul.
The file which has to be modified, referers.php, is only 15-20 lines big. Probably 10 minutes work. If you all here very busy, I am sorry, forget it and close this topic. If you have 10 minutes free time, please rewrite this file.

#10 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 28 March 2006 - 02:36 PM

spear, on Mar 28 2006, 05:05 AM, said:

I am with etomite almost 6-8 months. I don't know php. This code above is written by a friend. Look arround in the net and you will not find nowhere for free "last 10 referers in main page" modul. He wrote it specialy for me and I decided to share it to etomite comunity. He is very busy person and I don't want to force him now to learn etomite comands and to rewrite this modul.
The file which has to be modified, referers.php, is only 15-20 lines big. Probably 10 minutes work. If you all here very busy, I am sorry, forget it and close this topic. If you have 10 minutes free time, please rewrite this file.
I suggest that you learn some MySQL and PHP... Here is the code that will give the results you need... It will be up to you to make it pretty...
$referers = $etomite->dbQuery("SELECT * FROM ".$etomite->db."log_referers ORDER BY id DESC LIMIT 10;");
$i = 0;
while($row = $etomite->fetchRow($referers)) {
  $i++;
 $output .= $i.".) ".$row['data']."<br />";
}
return $output;


#11 spear

    Etomite Forum Fan

  • Member
  • Pip
  • 61 posts

Posted 28 March 2006 - 06:17 PM

Great ! Thank you Ralph !!! Ever you solve my problems. I owe you many beers :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users