Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
function _adsense_validate_channel($channel = 1) {
if ($group < 1 || $group > ADSENSE_MAX_GROUPS)
// Default to 1 if an invalid channel is supplied
return 1;
}
return $channel;
}
Change: if ($group < 1 || $group > ADSENSE_MAX_GROUPS) {
To: if ($channel < 1 || $channel > ADSENSE_MAX_CHANNELS) {
Comments
Comment #1
kbahey commentedPlease paste the following SQL in phpmyadmin or mysql and post the output here (you can mask your google client ID if you like)
SELECT * FROM variable WHERE name LIKE 'adsense%';
Comment #2
povinho commentedThe same! All channels gone. No identify number.
Custom Channels
Custom Channel ID:
Custom Channel ID:
Custom Channel ID:
Custom Channel ID:
Custom Channel ID:
The identifing number are gone and like "ataasgari" wrote an the code I also get:
google_ad_channel = "";
Comment #3
povinho commentedThe SQL result you asked:
Comment #4
kbahey commentedChange the following line:
To
See if that does it
Comment #5
povinho commentedOk!
That solved the most importante part! Now I get the Chanel ID back on the Page Source.
But the admin interface still doesn't number the "Custom Channel ID:".
Regards,
Comment #6
kbahey commentedChange this line:
To this:
Let me know if it fixed it.
Comment #7
povinho commentedProblems Solved!
You are the best! Keep up the good work :)
I'm just moving now to the Feature Request page to ask you to add the 300x250 format to the module.
I've chage the code to add that but. Each time a new release get out I've to add it again! I'll add the code there in a minute..
One more time thank you for your time. This has been a very usefull module in my site.
Regards,
Comment #8
kbahey commentedFixed.
Comment #9
povinho commentedHi!
I've just have notice that I get all adsence ads with the same chanel number. The Channel 1 number.
Regards,
Comment #10
povinho commentedHi! I've found the bug:
At:
Change:
if ($group < 1 || $group > ADSENSE_MAX_GROUPS) {To:
if ($channel < 1 || $channel > ADSENSE_MAX_CHANNELS) {Regards,
Comment #11
povinho commentedSorry I made a mistake:
Should be like this:
Change:
if ($group < 1 || $group > ADSENSE_MAX_CHANNELS) {To:
if ($channel < 1 || $channel > ADSENSE_MAX_CHANNELS) {Regards,
Comment #12
kbahey commentedFixed.
Comment #13
(not verified) commented