News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Ad Management mod

Started by SMFHacks.com Team, January 30, 2006, 08:41:19 PM

Previous topic - Next topic

vbgamer45

Admin -> Server Settings
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

cavem5

Currently have hundreds of these, and related, errors:

http://mysite.com/index.php?action=dlattach;attach=236;type=avatar [nofollow] [nofollow]
8: Undefined index: template_layers
File: /home/cavem5/public_html/Sources/LoadAds.php

http://mysite.com/index.php?action=dlattach;attach=236;type=avatar [nofollow] [nofollow]
8: Undefined index: default_theme_url
File: /home/cavem5/public_html/Sources/Load.php

Glasso

Quote from: quebo on March 02, 2011, 05:14:52 PM
I'm encountering problems with RC5 and Ad Management mod 3 when MSN bot is crawling my site, no other ip-adresses are logged with errors ... :

http://www.***.**/smf/index.php?action=dlattach;attach=986;type=avatar2: Invalid argument supplied for foreach()Bestand: /home/**/domains/***/public_html/smf/Sources/LoadAds.php
Line: 29
and
Undefined index: template_layers
File: /home/**/domains/***/public_html/smf/Sources/LoadAds.php
Line: 27
and
Undefined index: default_theme_url
File: /home/**/domains/***/public_html/smf/Sources/Load.php
Line: 1942
and
Undefined index: theme_url
File: /home/**/domains/***/public_html/smf/Sources/Load.php
Regel: 1941

Very weird problem, is there anybody who could help me out ?

Thanks in advance!


Quote from: cavem5 on March 05, 2011, 11:54:55 AM
Currently have hundreds of these, and related, errors:

http://mysite.com/index.php?action=dlattach;attach=236;type=avatar [nofollow]
8: Undefined index: template_layers
File: /home/cavem5/public_html/Sources/LoadAds.php

http://mysite.com/index.php?action=dlattach;attach=236;type=avatar [nofollow]
8: Undefined index: default_theme_url
File: /home/cavem5/public_html/Sources/Load.php

quebo & cavem5,

This worked for me for the same problems, you might test & try it at your own risk.

From http://simpleportal.net/index.php?topic=4232.0

index.php - replace

// Attachments don't require the entire theme to be loaded.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
detectBrowser();
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
else
loadTheme();


with:

// Attachments don't require the entire theme to be loaded.
/*if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
detectBrowser();
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
else*/
loadTheme();




cavem5

Thanks, giving it a try

quebo

@ŋlasso: thanks, that seems to work!!

SC RaceFan

#6005
Can some one help me with these errors. I was told my question belongs here. These errors seem to only be on guest and I have had no users complain.  I am new at this and not very sure of my self at this point
Oh, I'm running 2.0RC5
with these packages

1. Header Addon 1.0 [ Uninstall ]
2. Dog Avatars 1.0 [ Uninstall ]
3. Cats Avatars 1.1.2 [ Uninstall ]
4. Dance 1.0 [ Uninstall ]
5. Car Avatar Pack V1.0 1.0 [ Uninstall ]
6. Ad Managment 3.0 [ Uninstall ]
7. Porcelan Animals Avatars 1.0



Errors

Guest
66.249.72.140   
    Today at 04:08:33 PM
0edf889248d422c82d3d79f4c5a06891
Type of error: General 
http://*****.com/forum/index.php?action=dlattach;attach=3;type=avatar2 [nofollow] [nofollow]: Invalid argument supplied for foreach()File: /home/*****/public_html/forum/Sources/LoadAds.php
Line: 29 
   Guest
66.249.72.140   
    Today at 04:08:33 PM
0edf889248d422c82d3d79f4c5a06891
Type of error: Undefined 
http://*****.com/forum/index.php?action=dlattach;attach=3;type=avatar8 [nofollow] [nofollow]: Undefined index: template_layersFile: /home/*****/public_html/forum/Sources/LoadAds.php
Line: 27 
If I knew what I was doing, I would not be here asking question!  If I were a programmer, I would not need you!

vbgamer45

Posted an update to fix that issue.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Blade_Runner

Quote from: vbgamer45 on March 05, 2011, 08:00:03 PM
Posted an update to fix that issue.

The update doesn't fix the problem.

Guest
74.79.104.37   
http://modcarclub.com/forums/index.php?action=dlattach;topic=161.0;attach=2617;image
2: Invalid argument supplied for foreach()
File: /home/xxx/public_html/modcarclub.com/forums/Sources/LoadAds.php
Line: 30

Guest
74.79.104.37   
http://modcarclub.com/forums/index.php?action=dlattach;topic=161.0;attach=2617;image
2: Invalid argument supplied for foreach()
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 1890


vbgamer45

Try again posted another update
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Blade_Runner

Still have the same problem for guests. Got a few hundred errors in a few minutes.

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: default_theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2018

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2017

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: default_theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2012

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: default_theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2011

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2000

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 1999

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4569
8: Undefined index: default_theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2018

http://modcarclub.com/forums/index.php?action=dlattach;topic=824.0;attach=4568
8: Undefined index: theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 1990

vbgamer45

Those errors are not related to ad management mod.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

Except that other members have reported the same errors and the only thing in common is the Ad Management mod. Is there any check made to ensure that you're actually on a page that's going to display ads before adding to the template layers?
Holder of controversial views, all of which my own.



vbgamer45

Posted an update to skip on processing for attachments should fix some possible undefined errors.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


vbgamer45

Out of ideas for now will look at later next week.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

petb

Quote from: Blade_Runner on March 06, 2011, 10:28:38 AM
Latest c version doesn't fix the problem.

http://modcarclub.com/forums/index.php?action=dlattach;topic=845.0;attach=4638;image
8: Undefined index: default_theme_url
File: /home/xxx/public_html/modcarclub.com/forums/Sources/Load.php
Line: 2018
Got the same Problem with the same Results.
Only Guests produces the Errors.
And only if the Mod ist installed.

And if the Mod is installed on another System the Errors happend too.


Mayhem30

#6017
The MySQL query you use in this mod for SMF 1.1.x is not optimized - and does not make use of the PRIMARY index at all.

When I did a "EXPLAIN", Your query uses "filesort" (which happens to be the worst).



I recommend you changing the query in (Sources/LoadAds.php) to :

$query = db_query("
SELECT *
FROM {$db_prefix}ads
WHERE ADS_ID > 0", __FILE__, __LINE__);


Using the code above, makes full use of the PRIMARY index  - and no more 'filesort'. :)



vbgamer45

Updated removed the order by.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

Done removed the order by part and updated.

Other part that might update next is for the loadads to use caching functions to reduce sql query calls if you have caching enabled.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: