MyBB Community Forums

Full Version: Ads after First Post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I need help about the Ads after First Post, I activated it, but nothing appears and so on... any ideas ?
xiaozhu Wrote:Hello,

I need help about the Ads after First Post, I activated it, but nothing appears and so on... any ideas ?

I had the same problem.  I did the following and everything is working now...

Open the file inc/functions_post.php and search for the line:
----------
eval("\$seperator = \"".$templates->get("postbit_seperator")."\";");
----------

Add above the line the following code:
----------
    // Ads after first post
            if ($mybb->settings['adsafp_code_onoff'] != "no")
            {
                $query = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid = '".$post['tid']."' ORDER BY pid LIMIT 0,1");
        $firstpost_id = $db->fetch_array($query);  
                  
                if ($post['pid'] == $firstpost_id['pid'])
                {
                    if ($mybb->settings['adsafp_align'] == "1")
                    {
                    $ads_align = "left";
                    }
                    if ($mybb->settings['adsafp_align'] == "2")
                    {
                    $ads_align = "center";
                    }
                    if ($mybb->settings['adsafp_align'] == "3")
                    {
                    $ads_align = "right";
                    }
                    
                $adsafp = "<div style=\"text-align:".$ads_align."; background-color:".$mybb->settings['adsafp_bgcolor'].";\">".$mybb->settings['adsafp_code']."</div><!-- Plugin Ads after first post © 2005 MyBBoard.de (http://www.mybboard.de) -->";
                }
                else
                {
                $adsafp = "";
                }
            }
            // Ads after first post
Grr!!!

I did what u said, but it still didn't work! :evil:
Reference URL's