ADP2 dev: static vs dynamic pages

Bug Reporting and Feature Suggestions /Improvements go here.

Moderator: pgolovko

ADP2 dev: static vs dynamic pages

Postby pgolovko » 07/22/2007 4:55 pm

I'm thinking on dumping "static pages" feature out of the project.

The main reason is ADP2 can count incoming and outgoing traffic, sort links by hits in/out as well as by other options. Currently it can handle different templates for different sub/categories, where you can arrange links by "hits in" in one category, by "hits out" in another, and at same time by "Back links in Yahoo" in another, etc.
It has been requested to let site visitors resort the links as they want... ADP2 needs to break out of the static pages in order to offer this feature to the directory visitors. It is possible with dynamic pages, and not with static. Rebuilding the pages each time the user resorts directory listing or when you get another "hits in/out" from your links is not an option.

So here it is, I'm thinking on dumping "static pages" feature out of the project. Lets talk about that. Any suggestions, questions?
__________________
Best regards,
Pavel Golovko
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....


Postby iamoso » 07/22/2007 5:30 pm

Personally I think dynamic pages are perfect for almost any situation...

But in rare cases, caching may be the best way to go, say if it is a huge site with a lot of activity. Then maybe in that situation, link placement, etc can be cached, but in/out clicks could still be counted... And pages can be updated by a cron job set for a specific time...

BUT, if you are wanting to do something with end-user sorted pages... Obviously this does not really work.

That is my 2 cents.
Best Regards,

Ryan Jauregui
Laf Innovative

laf innovative
User avatar
iamoso
Site Admin
 
Posts: 395
Joined: 03/25/2006 1:23 am
Location: Stanton, CA

Postby pgolovko » 07/22/2007 6:17 pm

Problem is there are a lot of people that dont know how to use cron.
Another solution is to have static pages as an optional feature for those who need static pages and wont care for any of the above features :scratch:
__________________
Best regards,
Pavel Golovko
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....

Postby iamoso » 07/22/2007 7:50 pm

That could work, but maybe you can still count in/out clicks even though it is static... Using Javascript (like google does). It is an idea...

Something like:
Code: Select all
<a href="http://www.astanda.com" onclick="window.open(http://adp.genericthoughts.com/out.php?site=101); return false;" onkeypress="window.open(http://adp.genericthoughts.com/out.php?site=101); return false;">
That way when google crawls the website, it still picks up the direct link and disregards the JavaScript, and if a user has JS disabled, they will still default to the normal web page, it just will not be counted.

Also, you could do something like:
Code: Select all
<img src="/admin/regen-static.jpg" alt="" width="1" height="1" />
And what this "image" would do is when someone comes to the website it would check the current time and the regeneration time set up in the admin section, making a pseudo-cron. If the site is "stale" it will be rebuilt and if the user navigates to a new page or refreshes the page it will be updated with new click counts and everything.

Let me know what you think about that.
Best Regards,

Ryan Jauregui
Laf Innovative

laf innovative
User avatar
iamoso
Site Admin
 
Posts: 395
Joined: 03/25/2006 1:23 am
Location: Stanton, CA

Postby pgolovko » 07/23/2007 1:12 am

Here's how I count the hits:

header.html
Code: Select all
{literal}
<script type="text/javascript">
function out(id){
  image = new Image();
  image.src= 'http://2.astanda.com/index.php?out=' + id;
}
</script>
{/literal}
</head>
<body>


link in body.html
Code: Select all
<a href="{$item.url}" onclick="out('{$item.id}');">{$item.title}</a>


cut out from /index.php without IP check
Code: Select all
if(isset($_REQUEST['out'])){
   $result = mysql_query("SELECT `url`, `out`, `out_total` FROM `links` WHERE `id` = '".$_REQUEST['out']."'");
   echo mysql_error();
   if(mysql_num_rows($result)){
      while($row = mysql_fetch_array($result)){
         $url = $row[0];
         $out = $row[1]+1;
         $out_total = $row[2]+1;
         }
      }
   mysql_query("UPDATE `links` SET `out` = '".$out."', `out_total` = '".$out_total."' WHERE `id` = '".$_REQUEST['out']."'");
   echo mysql_error();
   header("Location: $url");
   exit;
   }
__________________
Best regards,
Pavel Golovko
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....

Postby iamoso » 07/23/2007 6:05 am

Cool, so that was basically the same thoughts I had. Think about the pseudo-cron, let me know if that is a good idea or not.
Best Regards,

Ryan Jauregui
Laf Innovative

laf innovative
User avatar
iamoso
Site Admin
 
Posts: 395
Joined: 03/25/2006 1:23 am
Location: Stanton, CA

Re: ADP2 dev: static vs dynamic pages

Postby bihlink » 07/26/2007 4:44 am

admin wrote:So here it is, I'm thinking on dumping "static pages" feature out of the project. Lets talk about that. Any suggestions, questions?

Well here is my 2 cents: Pavel you know my current situation, nothing is finally solved. At this moment i'm switched OFF using my database for day or two. BUT before i did it i turned on static pages and build directory so it look like site is UP and working. Add link and search doesn't work but at least i'm not loosing position on search engines.
And another thing is (i think so) that static pages are very important for people running ADP on slow servers. When search robots start visiting them very often they would probably keep database VERY busy if the site is running on dynamic pages. Am i right?
So i think that from start, static pages was great idea and will be even after...

So much from me
bihlink
 
Posts: 67
Joined: 05/08/2007 1:53 am

Postby pgolovko » 07/26/2007 9:30 am

Astanda.com always uses static pages, thats the way I prefer it to be, so I'll try to find a solution here. :scratch:
__________________
Best regards,
Pavel Golovko
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....

Postby iamoso » 07/26/2007 1:00 pm

So I am thinking you could use my suggestion (and quite similarly yours) above, and just leave out certain features if it is a static page. (i.e. the sorting of the listings by client view).

In the admin you can set the "regen-static.jpg" to on or off depending on if you want to build the static pages manually or based on a time schedule.

You can still track out clicks via the feature above. All should be well.
Best Regards,

Ryan Jauregui
Laf Innovative

laf innovative
User avatar
iamoso
Site Admin
 
Posts: 395
Joined: 03/25/2006 1:23 am
Location: Stanton, CA



Return to Bug Reporting

Who is online

Users browsing this forum: No registered users and 0 guests

cron