Closed (fixed)
Project:
Advertisement
Version:
6.x-1.x-dev
Component:
ad module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2008 at 21:19 UTC
Updated:
23 Feb 2009 at 22:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danba commentedFile is missing from 6.x-1.x-dev:
Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/ad/node.pages.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/topbigde/public_html/includes/menu.inc on line 344
Comment #2
moshe weitzman commentedAny updates?
Comment #3
jeremy commentedI've been on vacation for 2 weeks returning today, and I've seen no patches contributed. So, slow progress yet.
Comment #4
conniec commentedHurrah, Jeremy!
I just saw that you are converting your fantastic module for D6.
I don't have enough programming knowledge to help with troubleshooting, etc, but I'll be glad to test on my testsite and report back results. Downloading Dev module now.
Connie
Comment #5
dchaffin commentedI'm in need of getting this working in D6.4. I may be able to help if you can point me in a direction. I'm somewhat new to Drupal module development, but I am quite comfortable with PHP, am getting used to "Drupalish" code and am trying to learn more. Let me tell you where I am with it and then let me know where I might begin to look to help.
I've installed the module and enabled Ad, Click filter, Image Ad and Report. I created an ad group, set the display type to jQuery and created one ad in the group I created. I then went to Admin>Blocks and told it to display the ad group in a region on my page. I still have no ad showing up at all. There is not even any HTML being rendered at all. I tried the default ad group and I've tried both groups in multiple block regions. Nothing works.
Do you have any idea what my issue is or where I could begin to troubleshoot?
Thanks.
Comment #6
dchaffin commentedOK, I edited ad.module slightly and got my ads working finally. There were only two real steps I performed to make this work (after much testing to find the issue). First, the implementation of hook_theme() was commented out with the TODO block describing the work to be done. I un-commented the ad_theme function and then my whole site disappeared.
After much experimentation, I discovered the problem was with the theme_ad_display function was not working properly. There were two things I did here: first, I changed the function call '_drupal_add_js()' to 'drupal_add_js()'. This finally got some HTML rendered out, but it didn't like the URL and wouldn't load anything. I copied the URL it was trying to load into a new browser tab and got nothing. I replaced the &s in the URL with &s and it worked. I looked further into the module, but couldn't find a place to change this. I ended up putting in a str_replace function to change these. My final function looks like this ...
Again, I'm somewhat new to the module development thing, so I'm not real clear on the patch process yet. I'm attaching my modified ad module directory if someone wants to incorporate it.
Comment #7
manuel garcia commentedsuscribing... available for testing etc
Comment #8
Babalu commentedsubscribing
Comment #9
Babalu commentedi became the same error how #1
with the version from #6 too
Comment #10
jeremy commented@dchaffin: thanks for the contribution, however unless you upload patches it's highly unlikely that your contribution will be reviewed/used. Fortunately generating patches is easy, and there is a wealth of information on how to do it available here.
Comment #11
equalspeterd commentedsubscribe. In active deployment project which will depend on getting this ported to 6.4 willing to help out any way I can
Comment #12
Frank.Poulsen commentedI am currently working on a project where we need an advertising module, and instead of reinventing the wheel, we decided to try and get the ad module working in Drupal 6.
I had to make to minor modifications:
1. Uncomment to ad_theme() function
2. Add a new menu to the ad_menu() function
The 2nd modification is to enable the redirect, that otherwise comes up as a missing page. I assume this is caused by a change to the menu hook in Drupal 6. I dont know the Drupal 5 menu hook in details, and I dont know the original behaviour of the menu hook, but when I added the menu to the current hook, it works.
We are now able to add image ads, add the links and track click and views. We also tested the scheduling functions
I have attached the changes as a patch. This is the first patch, I have posted, so feel free to test and comment.
Comment #13
westblad commentedI have tested both the ad.module.patch contributed by Frank.Poulsen and the code modification suggested by dchaffin, and unfortunately problems persists for me on Drupal 6.5:
1) The ad content type does not display if allocated to a region on the block editing page. Essentially, I still have the same result as described by dchaffin in his post #5. But, I have tried other display types than jQuery and with the Raw display type an image ad does show, however, along with unwanted text lines "view counter". With the display type set to Javascript nothing is shown. With display type set to IFrame extra whitespace is added to the page where the image should be, but no image. One can, however, make an ad content type display on the front page in the main content region by promoting it. But this is not where you want ads to be most of the time.
2) An ad group cannot be edited or deleted. The page for these tasks cannot be evoked. Clicking on an edit link for an ad group in the list on the Ads page under the Groups tab is inoperative. Nothing happens.
I have successfully activated and used this module with Drupal 5. I would certainly very much appreciate (I'll sing and dance) if someone would make it work for Drupal 6.
Comment #14
Frank.Poulsen commentedI forgot to mention this in my previous post:
I am using the JavaScript setting, 1 group, and Drupal 6.5, but it works with the Raw setting as well. If I understand you correctly, the code modifications (mine or dchaffin), actually enables you to display the image under the raw setting, is that correct?
Also (although you probably already did this to be able to see your image at all), its important to clear your cache after the updates for Drupal to pick up the modifications.
You might be able to use the Raw setting, that apparently works for you, and change the template. I havent tried it.
Are you able to add a link to your image, or is that not necessary for your project?
Comment #15
westblad commentedSorry if I was a bit unclear in my post #13.
Without the uncommenting of the ad_theme() function, nothing is displayed. With the activated ad_theme() function I am able to display the image ad with the raw display type, not with any other type (javascript, jquery, iframe). I clear all cached data after code updates. And I have tried different themes (including the default one) with the same result.
Frank.Poulsens modification of the ad_menu() enables linking the image to an external web page, which is good. I could hide the div tags with CSS which displays the text "view counter" under the raw display type setting. However, since it is not possible to edit the group settings (the group editing page cannot be displayed) I can't change the weight, i.e., the order, of the image ads. This ordering functionality is very important for us since advertisers pay more for having their ad closer to the top of the page, and descending toward the bottom.
Somebody please.
ps. Tested with Drupal 6.5, IIS 5, on Windows 2003 Server. The module works fine on this setup with Drupal 5.x
Comment #16
famousb commentedGuys,
i haven't even gotten to the point of trying to display the ads on my site yet, i'm still trying to ensure the administration of them is at least functioning properly...
from the D6 install version, after i manage to create 2 test ads, then go to Content Management -> Ads, the list page is not displaying properly, as i get all of the info about the two test ads on one line, and then the two checkboxes directly below them, such as:
test text ad1test ad1defaultdefaulttextimageactiveactiveeditedit
(see attached .jpg for further clarification).
i found in ad.module where the form is created with function ad_admin_ads(), but do not know enough about Drupal and PHP to actually figure out how to fix it... i'm more of trial and error...
this is the current code for ad_admin_ads()
does anyone know the fix for this?
Comment #17
jrglasgow commentedThis patch straightens out the theme problem and the redirect problem.
Comment #18
jeremy commentedI've committed a modified, untested version of #17. Please don't make stylistic changes at the same time as trying to make bug fixes as that confuses things. Hopefully this is a step in the right direction, but more patches will be necessary to get the module fully working.
Comment #19
Flying Drupalist commentedWhat's the status of the port? Can we test this module now?
Comment #20
tgcondor commentedPlease inform when the module is ready for alpha or pre-alpha testing. I am willing to help by testing. If I manage to get something working that doesn't at first then I'll share a patch with the group. And thanks to all who are keeping the development moving forward!
Comment #21
fessio commentedSorry guys, but is it possible to make the redirect work anyhow? `Cause I get the "Page not found" error. It's strange that the $items["ad/redirect/%/%"] doesn't work, meaning that drupal doesn't even try to call the ad_redirect function when the above URL is accessed. Any ideas? Thanks
Comment #22
zilla commentedsubscribing realized i'd rather use this than google ad manager after all! no interest in pushing dozens of google remote scripts for block inclusions even if they do have reliable servers ;)
Comment #23
sersim commentedHi,
these 2 files are based on the 6.x-1.x-dev version released on 2008-Nov-20 and fix the following bugs:
- redirect not working;
- Destination URL and other fields not displayed in the new/edit ad form
I've tried text, html, image and embedded ads, and they work.
The group edit form is not displayed and I don't find how the feature "display ads based on node ids (nids), or taxonomy terms (categories)" can be used. Maybe it's not implemented yet.
I'm new to module development, so I hope I've not broken anything.
Comment #24
aflores3 commentedsubscribe
I got here trying to find solution to comment #1. Realized there is more to be done
Comment #25
danyg commentedsersim, thank you very much. I hope it will be built in next dev version, because it works.
Comment #26
jeremy commentedSersim: Thanks, however please upload unzipped patches, as zip files with complete files are not especially useful to me and are generally ignored. More information on how to create patches can be found here.
Comment #27
sersim commentedOk, these are the patches. I've done them with Eclipse, I hope they work.
You should apply these patches on the CVS file.
They fix the #1 problem too: the fatal error after clicking on the menu links 'html advertisement', 'image advertisement', 'text advertisement'.
I suggest you clear the cache (Administer > Site configuration > Performance) after applying the patch.
Jeremy, do you confirm that "display ads based on node ids (nids), or taxonomy terms (categories)" is not implemented yet?
Comment #28
NidSquid commented"You must specify a valid Destination URL" message keeps appearing.
sersim, thanks for your patches - I applied them and was able to get the url fields to show up when trying to create my ad. But now, after I try to save my ad, it keeps telling me I need to specify a valid Destination URL even though I have supplied one as requested.
I am trying to create a text ad to start and no matter what url I try, I continue to get this message. I tried just simply http://www.google.com for example.
Am I doing something wrong?
Thanks.
EDIT: if I disable Validate URLs from the Ad settings, it works.
Comment #29
aflores3 commentedsersim,
I have successfully installed & added html ads using your patches. Thank you.
I will continue to test and report bugs.
Comment #30
sersim commentedNidSquid, try this patch
Comment #31
NidSquid commentedThank you sersim, I will try it.
Comment #32
OneTwoTait commentedsubscribing... waiting for a release that works. :)
Comment #33
Anonymous (not verified) commentedHi,
i read all the comments and apply all the patches to the current dev release but none worked for drupal 6.6. when i clicked on the image banners it searches in the website instead of bringing the user to the ad site . anybody can post a link to full working one that has solved the "image advertisement" problem and the image banner link not redirecting the ad site.
Thanks for any help
Comment #34
sersim commentedHi UncleSam,
I use the patched ad module on Drupal 6.6 and it works.
I suggest you apply the following patches:
- ad.module_patch.txt and ad.module_patch.txt in the comment #27 of this issue;
- the ad.text patch;
- the ad.embed patch;
After that, you have to clear the cache: Administer > Site configuration > Performance
Let me know if it works for your installation.
Comment #35
neochief commentedFixed:
- Added support of %ad_group menu placeholder
- Ad Groups editing and deleting (which was commented)
- Redirect issues in form submits
- Added the $form_state into some form functions
- Some glitches with localization support
- Changed almost all confisuing code such as $a = "$variable" to more slick $a = $variable
- Meybe anything more, but too minor to remember
- Fixed click_filter module
Combined those with sersim's patch and attaching all latest patches in this thread.
Everythings seems to be working fine.
P.S. I spent 3 hours combining things together. Here's a graphical diff (800Kb) to ease somebody's life, who will do things in such way.
Comment #36
Anonymous (not verified) commentedhi
all the patches are for text embed and the ad.module itself but none for ad.image.module which I'm using . and after clearing the caching i'm still getting "image advertisement" link clicking error
Thanks
Comment #37
neochief commented@Jeremy
Please, commit those patches to the dev version, because there are too many changes made to proceed development comfortably.
Comment #38
jeremy commentedI am trying to make time to review the patches, but things are busy with the holidays and it's not clear when I'll have sufficient time for this. Perhaps next week. One big concern I have unrelated to the patches is that I have recently committed some significant changes to the 5.x development tree, and the 6.x branch is now way out of sync.
Comment #39
superflyman commentedsubscribing
Comment #40
WildBill commentedSubscribing
Comment #41
ericjam commentedplz fix soon :D And it would be easier if u could just post the updated file instead of .patch, I don't have Unix
Comment #42
todd nienkerk commentedSubscribing. I need to test this module in D6.x for a client. I'd rather go with a native Drupal solution instead of something like OpenX.
Comment #43
neochief commentedHere's the full patched module which I'm using right now on the live site, it includes all above changes.
Comment #44
OneTwoTait commentedGreat. Using ad.zip from #43 allows me to use Image ads and see reports.
Unfortunately, the Embedded ads aren't available. On "Administer >> Content Management >> Ads >> Settings" there is no "Embedded ads" link.
Comment #45
neochief commentedSorry, but some of such sub-modules as "Embedded ads" may not work. I've been concentrated only on major sub modules during this development session.
Comment #46
sersim commented@taite11 I've posted a patch for the Embedded ads at #34
I hope that Jeremy will have the time to commit the patches.
Comment #47
OneTwoTait commentedThansk sersim.
I made that patch (manually by adding the line... I assume that works). Here's the zip file from #43 plus the patch just mentioned.
Comment #48
StoreV commented#47 worked for me - thanks very much!
Comment #49
dave kopecekI can confirm that #47:
This is FANTASTIC. Thanks to everyone who contributed to the patches.
One question: Are clicks supposed to be displayed on the REPORTS tab ( /node/NODE_ID/report ) ? I'm getting a bar graph with the number of views, but no click info.
Comment #50
Anonymous (not verified) commentedHi,
#47 solved many bugs . but it still remains the #1 problem :
Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/ad/node.pages.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/topbigde/public_html/includes/menu.inc on line 344
Why?
Line 1277 of ad.module : 'file' => '../../../..//modules/node/node.pages.inc',
the relative path of "node.pages.inc" has been hard coded related to the location of ad.module. but not everybody put their modules folders under "sites/all/modules". i put mine under "sites/all/modules/contrib" for the contributed modules, "sites/all/modules/custom" for my custom modules. So the way to solve it for everybody is to provide a dynamic relative path that still get the file no matter where you put ur modules files. Attached is my solution
Comment #51
neochief commentedYeap, there are couple others, but personally I will not place patches further before commiting available changes to dev. version to not make our chaos in this issue bigger :)
Comment #52
clo75 commentedHi,
I have problems to get AD images correctly in Drupal 6.6.
I see the image test in the ad node editing interface, setting it as "active" but when I hit the "preview" I get the message "Unable to locate image" and of course when I publish it I was unable to get the ad image displayed correctly (in regular node or in blocks regions). Tried different options (Filtered HTML, Full HTML, Javascript, Raw...) and give correct ad display permissions. Tried also on differents installations (on line and local)
So I tried #43, #47 and #50 with Drupal version 6.8 , but none of them was able to display ad images on my configuration . Still get get the message "Unable to locate image" even when I cleared the cache.
Any clue ? Thanks.
Comment #53
MedicSean37 commentedI've d/l the files from post 50, 47, then 43. None of the version will allow me to see the add creationg form at node/add/ad/image or ..../text. I've uninstalled and reinstalled with no improvement.
Comment #54
Anonymous (not verified) commentedtry to check the number of ads allowed to be displayed in the blocks. also make sure u're enabled the ad blocks to be shown in the block u want it to be shown on
Comment #55
MedicSean37 commentedI did both. I still can't see the actual form. It gives absolutely no errors. No page not found, No access denied. No Watchdog logs. It's as if everything works, except actually viewing the form.
Comment #56
Stef01 commentedHi,
My main issue was the redirects on image ads not working. #47 solves this problem.
At least: when ad caching is not being used! So, in 'ads > global settings > cache' I have to set it to 'none'. As soon as I enable the caching to files the redirects don't work anymore.
Without caching, the URL that an ad redirects to is like "http://www.site.com/ad/redirect/115/t28/".
With file caching enable, the URL changes to "http://www.site.com/ad/redirect/115//", with a 'File not found' as a result when clicked on.
Any ideas what could be the reason? I would like to enable the caching for better performance.
Comment #57
demo9 commentedsubscribing...
#47 solves my problem for now (what I need now works)... but I eagerly await the 'official' updated dev version... Keep up the great work everyone! I'd love to help but my php skills (or lack there of) are getting in the way.
Comment #58
holesovice commentedHi,
I was having problems with a couple of issues.
txt ads not working
You must specify a valid Destination URL.
Using history
and editing of the groups.
#27 worked to get rid of the "You must specify a valid Destination URL." issue.
But now after #47 when trying to edit a txt ad I am getting "You must specify a valid Destination URL".
Don't know if I am the only one with this problem.
Also, I don't know if this is the place to report it but, when on the "global settings" page there are 15 errors being returned.
The module IS looking very interesting. And I would like to help with testing, so, if there is anything I can do....
Comment #59
bgadmin commentedsalimane, it is a great job! thanks a lot.... now i will going to visit your site to see is there some more extras! Excellent Work
Comment #60
jeremy commentedConverted the latest tarball into a patch so I can review. Attached.
Comment #61
jeremy commentedHere's what I'm committing. Sadly the 6.x branch is very out of sync with the 5.x-dev branch now -- merging in all the changes will be a rather major challenge.
Comment #62
jeremy commentedHere's what I'm committing. Sadly the 6.x branch is very out of sync with the 5.x-dev branch now -- merging in all the changes will be a rather major challenge.
Comment #63
jeremy commentedCommitted, ready for the next round of fixes... :)
Comment #64
neochief commentedI'm close to completion of full convertion of Advertisement into D6. It includes dozens of changes and fixes, db schemas for all modules. I'll prepare patch and upload it with patched files today.
Comment #65
keith.smith commentedsubscribe
Comment #66
neochief commentedAt last, I finished my 2 week development session. Here's the results:
Completed:
Still possible needs work:
Some thougts:
$editin ad_image? Same.Attaching patch and archive with all patched files. Before installation, you should remove your existing ad module folder, because some files was removed and some added. Also, you should use update.php to update database (even if you already have Ad D6), because of some minor changes in database columns (such as some INT became TINYINT, etc.)
As for the patch, I hope it will apply, though it's almost 300Kb and changes most of module's files :)
Comment #67
neochief commentedAs everything works for me on live site and since now I can commit to the module, I can roll this patch by myself to dev. version. But it would be nice if someone check this out just in case.
Comment #68
jeremy commentedYou have not yet been given commit privileges to this module -- I will review your patch soon, but I'm busy at the drupal.org upgrade sprint and haven't been able to do so yet.
Patience. I will review soon.
At a very quick initial and trivial glance, your patch is incorrectly updating the .info files. Please strip them from your patch.
Comment #69
neochief commentedAh, yes, sorry, my bad. Stripped them from patch.
As for the privileges — I thought so too, until didn't done this by mistake :)
I don't know, where I can actually commit as one of developers as I didn't saw this functionality on drupal.org up today.
Comment #70
jeremy commentedAs you have an approved CVS account, you can add/modify modules/NAME/po/ files. This is how the drupal.org infrastructure has been designed.
Comment #71
jeremy commentedMoving back to "needs review" status.
Comment #72
neochief commentedThanks for explanation, Jeremy.
Comment #73
manuel garcia commentedI have successfully upgraded the module from 6.x-1.x-dev (2009-Jan-26) to the one provided on #66, on a local install for testing porpuses. I have clicked around a bit, though no time to fully test everything atm. I have not tested the patch, but I thought I'd let you know that the upgrade went fine :) - thanks !!
Results:
Comment #74
jeremy commentedAnother superficial change that needs to be removed from the patches -- you're stripping all my copyrights. Sorry, but I won't merge that portion of your patch. The code is still under the GPL, but my (c) will be staying in.
Comment #75
jeremy commentedIssues:
- It seems that a call to drupal_uninstall_schema('ad') is missing in ad.install.
- you are adding back in a call to the nonexistent _drupal_add_js(), and removing lines from the changelog, backing out a recent commit
- s/standart/standard/
- do not strip my (c)'s
Comments:
- I'm very happy to see that you've gone ahead and split the module into ad.page.inc style files.
- I like how you've split out the ad_owners functionality into its own module
- It seems that you didn't get to perform your cleanup on ad.admin.inc yet, with TODO's left, missing comment, etc.
- In general you have done some very nice and very thorough cleanup, nice work!
This patch is obviously a huge step forward, not only for stabilizing a 6.x release but also for cleaning up the code and standardizing on Drupal's coding style throughout the module. I have not actually done any functionality testing, I only read through the patch. But once the minor issues I've listed above are addressed I will merge and we can fix any functionality bugs that may exist later.
As for views support, that is welcome but needs to be implemented in this external project (you have CVS commit permissions there, so feel free to make ad_view commits if you're interested).
I'm okay with moving the stats from the node edit form.
I do not understand what you mean re ad_image.
As Drupal 6 no longer requires LOCK's, we should indeed move them from the Ad module. The locks need to be reviewed to be sure we're not introducing a race that can corrupt things.
A major effort left is to port the new modules and functionality in the 5.x-dev tree into 6.x. But I am going to "simplify" this by reworking the 5.x branches turning the new development effort in 5.x-dev into 5.x-2 (leaving 5.x-1 at 5.x-1.6).
Thanks!!
Comment #76
jeremy commentedAll development to the ad module that has happened since the 6.x code was branched from the 5.x code has been moved into the 5.x-2.x branch in CVS. This allows us to focus on stabilizing the 6.x-1.x code first before moving on to porting the 6.x-2.x changes.
Comment #77
neochief commentedYes, I striped all of the copyrights in files with my changes. Yes, the reason was in GPL. Actually, I don't care on this license stuff, except the fact that big part (if even not half) of the module's code is now have not only single authorship.
Also I removed all of the MAINTAINER.TXT files except one in module root. Thoese files was present in some modules, but not in others. So I just cleaned up this part.
Anyway, I can bring copyrights back into the module, if you insist. It's not big deal personally for me, but I rather leaved one big copyright notice somewhere in the module's root.
Comment #78
jeremy commentedReview the Linux kernel source code files for an example of (c) (or multiple) in each file. My (c)'s will stay, and the code remains GPL'd.
I'm fine with a single MAINTAINER file.
I'm happy with people writing their own logic/features/submodules and adding thier own (c) into the files they add if they like. So far nobody has contributed to the module in this way (and likely if they did I would want the sub-module to live in its own project anyway -- the core project has too many modules already imo).
This is important to me, if you are opposed to it let me know and I'll respect your wishes and not merge your patch.
Comment #79
neochief commentedOkay, Jeremy, I just wanted to know your position to this. I'll bring all copyrights back.
As for the ad_image, $edit which I'm talking about is in ad_image_validate_size() function.
For your comments:
- drupal_uninstall_schema('ad') is present. It is not in patch, because it's already been in the file. In patched file you can find it just at start of ad_uninstall().
- I'll change _drupal_add_js() in nearest patch.
- I'll replace 'standarT', just error from russian habit — in russian this word with T on end :)
- Bring back copyrights.
These and other changes I'll make today and upload patch so we could have a ready 6.x-dev.
Comment #80
jeremy commentedOkay, please only make those changes and then commit the patch. You are now an Ad module maintainer. Welcome! And again, thank you!
Comment #81
neochief commentedGreat, thanks!
Comment #82
neochief commentedCommited!
Comment #83
neochief commentedAnd one last thing — translation template. I generate it after applying patch in #346454: Rename "Views" term to "Impressions" (which is not commited yet), so it's mandatory for the release too. I can commit all of these after confirmation.
Comment #84
neochief commentedad.pot commited. The only thing taking us from beta-release is now ad_weight_percent module.
Comment #85
Mrzeigler commentedSubscribing, with great appreciation to those who are getting this project D6-ready.
Comment #86
neochief commentedFound a fresh bug — Ad owners tab is showing not only in Ad nodes. Here's a patch.
Comment #87
jeremy commentedThis should show up for uid 1 who has all permissions. This should also show up for any user that has 'administer advertisements' permissions.
Why are you showing this tab to people with 'access statistics' permissions? I think it should only be visible if they have 'manage owners' permission for that particular ad..?
Comment #88
neochief commentedI beg a pardon, wrong patch ("midnight-coding-effect"). Here's a correct one.
Comment #89
jeremy commentedYou may as well edit this line, too:
You no longer need to pass in 'manage owners' there.
Once that's fixed, looks great! Commit when ready.
Comment #90
neochief commentedCommited. Thanks for review!
Comment #91
jeremy commentedClosing this issue -- let's track it in smaller issues now as we find and stamp out the remaining bugs.