Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 208
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 190
Total: 190

Author Topic: problem adding ads on specifical boards / adseller2.php  (Read 5288 times)

0 Members and 1 Guest are viewing this topic.

Offline kohai.raul

  • Member
  • *
  • Posts: 9
    • View Profile
problem adding ads on specifical boards / adseller2.php
« on: March 01, 2016, 11:38:06 am »
Hi all!

My site makes use of TinyPortal and PrettyURL. I tried for some days adding some ads to specifical boards, without luck!.

So I decided to test the source code and I've seen some strange behavior on ShowAdLocation() function (at Sources/adseller2.php)

Around line 2480, we can see:

Code: [Select]

if (isset($_REQUEST['board']) || !empty($board))
{

if (!empty($board))
$bID = (int) $board;
else
$bID = (int) $_REQUEST['board'];



$boardCheck = " AND ((l.showinallboards = 1 OR  FIND_IN_SET($bID, l.boards)) AND (a.showinallboards = 1 OR  FIND_IN_SET($bID, a.boards))) ";
}

By testing the values of  REQUEST['board'] and bID, I've seen the following:

Code: [Select]
       

            [REQUEST_board] => 150
            [board] => Array
                (
                    [id] => 62
                    [name] => Cliparts imágenes longitudinales
                    [child_level] => 2
                    [selected] =>
                )

the correct value is on Request_board. I don't understand why bID = 62, because it does not corresponds to the current board.

The solution applied was to substitute this portion of code by:

Code: [Select]
if (isset($_REQUEST['board']))
{

  $bID = (int) $_REQUEST['board'];



$boardCheck = " AND ((l.showinallboards = 1 OR  FIND_IN_SET($bID, l.boards)) AND (a.showinallboards = 1 OR  FIND_IN_SET($bID, a.boards))) ";
}

Depending totally on board parameter from request.

Has anyone experienced a similar situation?

Best Regards,

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: problem adding ads on specifical boards / adseller2.php
« Reply #1 on: March 01, 2016, 12:00:13 pm »
The request [board] should never be an array.
Not sure where [REQUEST_board] is coming from is that from Tiny Portal?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline kohai.raul

  • Member
  • *
  • Posts: 9
    • View Profile
Re: problem adding ads on specifical boards / adseller2.php
« Reply #2 on: March 01, 2016, 12:07:59 pm »
Hi,

I think it corresponds to the "board" parameter,

http://mydomain.com?board=X

I've needed move the adSeller snippets from Themes/default/messageindex.template.php to Themes/reseller/messageindex.template.php

maybe it's a problem introduced by Reseller  (a responsive theme)...


Offline kohai.raul

  • Member
  • *
  • Posts: 9
    • View Profile
Re: problem adding ads on specifical boards / adseller2.php
« Reply #3 on: March 01, 2016, 12:09:53 pm »
I'm Sorry!

when I said about [board] => array (...) I meant $board at the following portion of code:

Code: [Select]
...
if (!empty($board))
$bID = (int) $board;
...



« Last Edit: March 01, 2016, 12:11:24 pm by kohai.raul »

Offline kohai.raul

  • Member
  • *
  • Posts: 9
    • View Profile
Re: problem adding ads on specifical boards / adseller2.php
« Reply #4 on: March 02, 2016, 04:51:02 am »
Hi all!

By now, basing on original code on ShowAdLocation:

Code: [Select]
global ..., $board, ...;


if (isset($_REQUEST['board']) || !empty($board))
{

if (!empty($board))
$bID = (int) $board;
else
$bID = (int) $_REQUEST['board'];



$boardCheck = " AND ((l.showinallboards = 1 OR  FIND_IN_SET($bID, l.boards)) AND (a.showinallboards = 1 OR  FIND_IN_SET($bID, a.boards))) ";
}

By reviewing default/MessageIndex.template.php and reseller/MessageIndex.template.php, the only $board var I've seen in both, corresponds to a previous iteration:

Code: [Select]
...
foreach ($context['boards'] as $board)
{

...
                 } //end foreach


 showAdLocation(...);


And it's always empty. But this global var applies to BoardsIndex.template.php, where $boards gets the following structure:

Quote
[boards] => Array
                        (
                            [150] => Array
                                (
                                    [new] =>
                                    [id] => 150
                                    [name] => Preséntate. El sitio de partida
                                    [description] => Visible sólo para usuarios registrados. Preséntate y cuéntanos cuál es tu relación o expectativas con respecto a la permacultura.
                                    [moderators] => Array
                                        (
                                        )

                                    [link_moderators] => Array
                                        (
                                        )

                                    [children] => Array
                                        (
                                        )

                                    [link_children] => Array
                                        (
                                        )

                                    [children_new] =>
                                    [topics] => 42
                                    [posts] => 478
                                    [is_redirect] => 0
                                    [unapproved_topics] => 0
                                    [unapproved_posts] => 0
                                    [can_approve_posts] => 1
                                    [href] =>index.php?board=150.0
                                    [link] => Preséntate. El sitio de partida
                                    [last_post] => Array
                                        (
                                            [id] => 11279
                                            [time] => 19 Agosto de 2014, 03:55:26 pm
                                            [timestamp] => 1408456526
                                            [subject] => Re:Nuevo en el foro
                                            [member] => Array
                                                (
                                                    [id] => 9803
                                                    [username] => Isma
                                                    [name] => Isma
                                                    [href] => index.php?action=profile;u=9803
                                                    [link] => Isma
                                                )

                                            [start] => msg11951
                                            [topic] => 2553
                                            [href] => index.php?topic=2553.msg11951#new
                                            [link] => Re:Nuevo en el foro
                                        )

                                )

                            [151] => Array
                                (...)
    )

But it's not usable by ShowAdLocation in this situation...

So, from this point I don't understand the reason why ShowAdLocation makes use of global $board... it seems an unusable case...

what do you think about this???

Best Regards,
« Last Edit: March 02, 2016, 04:54:39 am by kohai.raul »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: problem adding ads on specifical boards / adseller2.php
« Reply #5 on: March 02, 2016, 07:57:07 am »
Hmm never noticed it before
What you can do is change your ShowAdLocation(###)
To

ShowAdLocation(###,$_REQUEST['board'])

In the messageindex area at least and that will fix that issue.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline kohai.raul

  • Member
  • *
  • Posts: 9
    • View Profile
Re: problem adding ads on specifical boards / adseller2.php
« Reply #6 on: March 03, 2016, 03:11:11 am »
Thanks, but I tested before. It works well in case of "Top Message Index" and " Bottom Message Index", but I've detected that another ads on Tiny-Portal's Blocks and customised locations that must be visible in the context of MessageIndex, they were not.

Definitely by changing the mentioned piece of code for the following, works great in my case:

Code: [Select]


        if (isset($_REQUEST['board'])){
$bID = (int) $_REQUEST['board'];
}


I'm not sure, but maybe this behavior is connected with my own scenario and it don't applies to common situations.  It's a behavior don't detected before on AdSeller and this seems strange.

best regards,
« Last Edit: March 03, 2016, 03:30:21 am by kohai.raul »

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
10534 Views
Last post May 28, 2006, 04:08:58 am
by gamesmad
5 Replies
7928 Views
Last post September 15, 2007, 10:41:18 am
by SMFHacks
2 Replies
4749 Views
Last post October 15, 2007, 07:32:45 pm
by merosler
1 Replies
5616 Views
Last post November 15, 2008, 02:03:25 pm
by SMFHacks
2 Replies
3766 Views
Last post June 20, 2010, 11:40:37 pm
by Cutter

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal