| |||
|
O.K. I give up and need help with a plugin I am currently working on. I have been trying to get this to work correctly for 2 weeks and I need some fresh eyes. Hopefully Bruce, one of the programmers, or someone else can help me solve this problem. This is a difficult one for me to put into words, by I'll give it a shot. I am creating a banner rotation script from an idea I originally got from echo@. It stores the banner information in the database. When called for the first time, it records the users IP and the banner they were shown. The next time the page is called, it checks the database and selects a different banner than the one just displayed and updates the dabase with the new banner ID. It works flawlessly if I attach it to one html hook. However, if I attach it to more than 1 hook, it does not work correctly. Hopefully that is not too confusing, but if it is have a look for yourself. INDEXU Deluxe - Link Management On the front page, I have it attached to the hook "hook_html_index_welcome". You can refresh the page a million times and because I have 2 banners being displayed, it will display a different banner each time. Now I also have it attached to the hook "hook_html_add_form_begin". Click on "Add a Listing" at the top of the page. You will see the banner near the top. Now refresh the page a couple of times. The banner is not rotating. Why? If I remove either hook from the code, it displays perfectly on the 1 remaining hook. No matter which hooks I attach it to, if I have more than 1, it has this bug. I already have the script set up to add, edit, and delete banners from the admin area. I would like to add the ability to add hooks from the admin area as well. I want to be able to display the banners from any hook location on multiple pages. With this bug, this plugin is almost useless unless you only want to attach it to 1 single file. Please help me figure this one out. This could be a very useful plugin. If you need it, I can send the files so you can look it the code. I don't think it's in my code though, I think it's in the way IndexU handles the hooks in the plugins. Regards Wayne
__________________ For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com |
| ||||
|
Wayne... I know nothing about this... But could it have anything to do with caching???
__________________ FSGDAG | IndexU Hosting | Owner Website | NiceCoder Script Hosting and More! | Web4URL is For Sale! Follow Us On Twitter | FaceBook Profile | YouTube Videos |
| |||
|
On the add.php the banner DID change for me. For the first couple of refreshes I saw the bash bosh banner 2 or 3 times and then the jbholcombe banner. Then I refreshed again and saw the bash bosh banner 2 times and then the jb banner once, after that it is now going back and forth. I'm not a programmer, and you can gladly talk to the programmers about this, but I think the issue is related to the php session. Perhaps what you need to do is to write a cookie as well. the cookie gets written with the LAST banner ID, the script checks it, compares it to the database and then writes the second banner ID. It keeps going until it reaches the end and starts the cycle back at the first banner. Using this method, you could have zones (zone1=top, zone2=side etc) and you could count then all off and rotate all of them.
__________________ Apparently Dody didn't like my signature saying "not the admin" so he deleted it. Did he not notice the fact that my title still says "administrator" and I haven't been the admin for months? |
| |||
|
The add.php page banner is occasionally changing but giving strange results in the database. When banner 1 displays, it enters banner 2 in the database and vice versa. Also, if I clear the template_c folder after each refresh, it works perfectly. So FSGDAG may be somewhat close in saying that it has something to do with caching. Using cookies for this is a great idea, I will try that if I get this problem solved. I plan on using zones so you could set more than 1 banner per page. What stumps me is why does it work perfectly when attached to 1 hook, but then gets this bug when I attach it to 2 or more hooks? If I remove it from the "hook_html_index_welcome" it works perfectly on the add.php page. Regards Wayne
__________________ For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com |
| |||
|
Perhaps because plugins are cached by default (I don't know how to disable that) so that IndexU will run faster without having to include files each time a plugin is loaded.
__________________ Apparently Dody didn't like my signature saying "not the admin" so he deleted it. Did he not notice the fact that my title still says "administrator" and I haven't been the admin for months? |
| |||
|
Of course I can share it. I appreciate the help. I have attached the entire plugin to this post. The hooks for displaying the images/banners are on lines 147 & 178 of the image-rotator-plugin.php file. I tried storing the banner contents in a variable before calling using something similar to: Code: Content visible to registered users only. Please register at http://www.nicecoder.com/community/register.php Code: Content visible to registered users only. Please register at http://www.nicecoder.com/community/register.php If anyone else would like to try the plugin out, feel free to install it. Just keep in mind that it is not production ready and has not had extensive testing. If you want to try it out and give me your feedback or feature requests, that would be great. Please do not use it on a live site, use a test installation to test it. After installing the plugin, there will be an added menu on the left in the admin area. The menu allows you to add, edit, and delete images. The only required field is the image itself, all others are optional. Just remember, it's maybe only 70% done. I want to solve this problem before I waste my time on adding more features and cleaning up the code. Regards Wayne
__________________ For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com |
| ||||
|
Nakos did you find the solution? BTW this is a very very cool plugin even if it is 70% complete
__________________ ____________________________ http://www.articleconveyer.com Give Your Articles Exposure |
| ||||
|
hello, i have tried, there is weakness on hook_php_init, that is run before filtered, perhaps the process catched by RunPreFilter. then i tried to set hook on hook_php_add_begin, it work out. for next version, i have added some hooks on lib.filter.php, you could download it from svn [http://nicecoder.com/svn/index.php?act=changeset&id=973]. if you have got the latest svn, let modify your code from Code: Content visible to registered users only. Please register at http://www.nicecoder.com/community/register.php Code: Content visible to registered users only. Please register at http://www.nicecoder.com/community/register.php Last edited by nakos; 02-03-2009 at 01:00 AM. |
| |||
|
Thank you nakos for helping out. I quit working on the plugin because I could not get this worked out, hopefully that will do the trick. Now I will see if I can finish it. Regards Wayne
__________________ For questions related to any mods I developed, please contact me by pm or email at webmaster [at] scriptdragon [dot] com |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Do you use the VB plugin? | Bruceper | Customers Lounge | 16 | 03-13-2009 12:47 AM |
| Plugin HELP | Rockyuk | INDEXU DELUXE v1.x | 3 | 01-01-2009 11:59 AM |
| More plugin hooks please | mpdaddy | INDEXU DELUXE v1.x | 28 | 11-05-2008 12:56 AM |
| Plugin Ideas | echo@ | INDEXU DELUXE v1.x | 1 | 10-06-2008 02:09 PM |
| Indexu to Vb plugin | echo@ | INDEXU DELUXE v1.x | 1 | 09-26-2008 04:08 PM |