vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Toplist (https://vborg.vbsupport.ru/showthread.php?t=98646)

derekivey 06-11-2006 03:25 PM

Quote:

Originally Posted by derfelix
Hi Derek
Big thumbs up.. havent updated yet cause im just upgrading vbulletin..
but looks great with all the new features!!!

may i add a couple of wishes for next release???
(i'm comparing the features to my existing external toplist)

functionality:
- add a cron to reset the counts..
why? because if any new sites are added.. they will never be able to move up if some sites have been there for years with thousands of ins and outs. (usually i have a cron on a weekly base ... but a reset once a month would be fine also)

- add a cache to the generated banners
if the site that uses the stats banner has 1.000.000 hits a day.. it will be generated 1.000.000 times ON YOUR SERVER. (cache update once an hour or day.. or only if things change)

- change the layout to standard banners 468x60
When using the standard banners.. the layout gets to wide specially if you are using a left navigation block.. it would be, for those banners much nicer if the banner was between site title and description, not needing an extra column.

- only show banners for the first 10 or 20 or 30 sites
the banners for the others should not appear. (sort of reward for good sites)

Last .. but this is just the frosting on the pie

- have a plus [+] minus [-] or equal [=] sign near the ranking
so users would know if this site is coming up or loosing rank.. example i a site is ranked 4 it would have a symbol besides the rank (or somewhere else) if the former rank was 3 it would be a [-] .. if the former rank was 10 it would be a [+].. and if nothing has changed.. ie. the former rank was 4 in the last 24 hours so.. it would be [=]... hmm i'll check with my toplist pro what criteria they use for [=]

sorry if one of these features is allready implemented.. as i said i will only be upgrading during the week. (I only looked at the changelog)
But I think its great and looks very professional now!!!!!

And last... just had an idea.. and i dunno if its easy to implement..
- if a user has a homepage in his profile, add a little checkbox in his settings so he can have it added automatically to the toplist (it should tell him to add a banner as soon as possible)

thats all for now.. no more ideas

Felix

Hey,

Nice ideas! I think I will add most of them, but I don't know how I would go about creating a cache for the generated banners. Do you know how I could do this?

Also, I'm not sure how I can add a plus, or negative sign right now because it would probably require me to rewrite a lot of the script. Right now, the ranks are not stored in the database, so there is no record of their old ones at all. I could probably make another table in the database to store them but not sure yet, I'll have to see about that one.

Derek

derfelix 06-11-2006 04:38 PM

Quote:

Originally Posted by derekivey
Hey,

Nice ideas! I think I will add most of them, but I don't know how I would go about creating a cache for the generated banners. Do you know how I could do this?

well the way i would do it, (but i often have clumsy solutions :confused: ) ist that i would create a cache folder.. and generate the jpg or png in there.. as filename i would use a name underscore banner id (ex: statsbanner_000001.jpg)
the cache folder schould be 777
and each time a banner is created dont forget the chmode 0777 so it can be overwritten by a newly generated one.
(I forgot that one.. because it worked fine without it.. -the script being the creator- but when i upgraded to another version of my script.. i couldnt access the files anymore) heres the code snippet for the file creation:
PHP Code:

$stats_banner "statsbanner_" $banner_id ".png";
@
imagepng($sourcebanner$cache_path $stats_banner);
@
chmod($cache_path $stats_banner0777);
//send banner to browser
@imagepng($sourcebanner); // yes source banner.. as we just created it.. no need to fetch from disk
@imagedestroy($sourcebanner); // free memory as some systems dont do it automatically 

You probably know it.. but as i just spent 3 hours finding out why my other script didnt work after upgrade.. i thought a reminder to add the chmod wouldn't harm.. and maybe even save time ;)
Ah yes and i think i read that php 5 doesnt like the @ in front of the commands.. but im not sure..


in the script that calls the banner...

if -> no cache banner exists for this banner id.. ->
create new one (like now) ->
but save it to cache ->
and then display it (on the fly like done now) (SEE THE CODE SNIPPET ABOVE !!)

else

if -> cache banner exists for this id.. ->
check creation time ->


if it is older than (now) minus offset ->
create new one ->
overwrite the old one ->
display it on the fly (like it is done now) (SEE THE CODE SNIPPET ABOVE !!)
else (it was created between now and (now-time offset))
do nothing and only display the cached one
with:
PHP Code:

$stats_banner "statsbanner_" $banner_id ".png";
readfile($cache_path $stats_banner); 

time offset should be changeble by admin (xx minutes) (xx hours) (maybe days) but no complicated milliseconds settings..
if no time offset is set.. then all banners are created on the fly and caching is disabled.



this would not require database for cached banner.. difference to offset is calculated by file creation time.
it would be better than to create it on change of stats.. because that would require database.

thats the way i would do it.. but there is maybe a better way..


Quote:

Originally Posted by derekivey
Also, I'm not sure how I can add a plus, or negative sign right now because it would probably require me to rewrite a lot of the script. Right now, the ranks are not stored in the database, so there is no record of their old ones at all. I could probably make another table in the database to store them but not sure yet, I'll have to see about that one.
Derek

hey that is absolutely not a must.. its just a nice feature.. but i wouldn't place it top on the todo list..

felix

michaelsilvia 06-11-2006 11:36 PM

I am attaching the image.

Also, I am having a new problem with categories. How do you delete or edit categories? I get this error.

Quote:

Sorry, you cannot edit a category without first selecting one. Please try again, and make sure a id is included in the url.
There is no way to select the category in the ACP.

Mike

DementedMindz 06-12-2006 05:03 AM

ok fixed my other problem but whats up with Main Category you cant delete or edit that or something? i try to delete it or edit and its telling me Sorry, in order to delete a category you must select an ID to delete. Please try again.

loonytune15 06-12-2006 03:09 PM

Nice ideas in there :)
Still got 2 bugs currently.
1. none of the images are working in the admincp.
2. I hvae slected the optin to open in new window yet it still opens in the same window.

Any ideas?

derekivey 06-12-2006 03:35 PM

Quote:

Originally Posted by derfelix
well the way i would do it, (but i often have clumsy solutions :confused: ) ist that i would create a cache folder.. and generate the jpg or png in there.. as filename i would use a name underscore banner id (ex: statsbanner_000001.jpg)
the cache folder schould be 777
and each time a banner is created dont forget the chmode 0777 so it can be overwritten by a newly generated one.
(I forgot that one.. because it worked fine without it.. -the script being the creator- but when i upgraded to another version of my script.. i couldnt access the files anymore) heres the code snippet for the file creation:
PHP Code:

$stats_banner "statsbanner_" $banner_id ".png";
@
imagepng($sourcebanner$cache_path $stats_banner);
@
chmod($cache_path $stats_banner0777);
//send banner to browser
@imagepng($sourcebanner); // yes source banner.. as we just created it.. no need to fetch from disk
@imagedestroy($sourcebanner); // free memory as some systems dont do it automatically 

You probably know it.. but as i just spent 3 hours finding out why my other script didnt work after upgrade.. i thought a reminder to add the chmod wouldn't harm.. and maybe even save time ;)
Ah yes and i think i read that php 5 doesnt like the @ in front of the commands.. but im not sure..


in the script that calls the banner...

if -> no cache banner exists for this banner id.. ->
create new one (like now) ->
but save it to cache ->
and then display it (on the fly like done now) (SEE THE CODE SNIPPET ABOVE !!)

else

if -> cache banner exists for this id.. ->
check creation time ->


if it is older than (now) minus offset ->
create new one ->
overwrite the old one ->
display it on the fly (like it is done now) (SEE THE CODE SNIPPET ABOVE !!)
else (it was created between now and (now-time offset))
do nothing and only display the cached one
with:
PHP Code:

$stats_banner "statsbanner_" $banner_id ".png";
readfile($cache_path $stats_banner); 

time offset should be changeble by admin (xx minutes) (xx hours) (maybe days) but no complicated milliseconds settings..
if no time offset is set.. then all banners are created on the fly and caching is disabled.



this would not require database for cached banner.. difference to offset is calculated by file creation time.
it would be better than to create it on change of stats.. because that would require database.

thats the way i would do it.. but there is maybe a better way..




hey that is absolutely not a must.. its just a nice feature.. but i wouldn't place it top on the todo list..

felix

I'll look into adding the cache but can't make any guarentees, I was also thinking about maybe moving the buttons to the database instead of using file storage but I'm not sure yet.

derekivey 06-12-2006 03:43 PM

Guys,

Please try uploading the attached file to the admincp directory to see if it fix any of those bugs. It seems to be working for me but I want to make sure.

Thanks,
Derek

derfelix 06-12-2006 04:09 PM

i personnally think that putting graphs in the dbase takes more ressources than filesystem.. anyway noone can find the cachefolder if you get it with readfile
--------------
Just looked at my standalone toplist and found what I was missing here:

Anti cheat..
we have now the ability to control if the code is on the users site.. great.
but the user could click hundreds of times on his banner on his site.. giving it lots of ins! there are 2 ways of preventing this.. by logging ips.. and with cookies..

second:
a user links out to his site.. this is a good and clean site.. its ok..
after a week.. he changes the outlink and sends people clicking his banner to a viagra site.. or a ringtone site or a porn site.. his outlink the admin should be notified. (ok... as few of these sites will have the code - which is checked here - it is only of minor importance)

Felix
@derek
if you wish i can pm you admin info for that toplist so you can take a look at the admin interface.

loonytune15 06-12-2006 04:14 PM

that file you atached works Derek. I am now showing the images in the admincp.

but the open in new window still doesn't work.

derekivey 06-12-2006 04:45 PM

Ok I'll take a look at that loonytune15. Do you still have the categories problem though?


All times are GMT. The time now is 05:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02536 seconds
  • Memory Usage 1,795KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete