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: 218
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 214
Total: 215

Author Topic: Place ads in a stand alone php file?  (Read 4189 times)

0 Members and 1 Guest are viewing this topic.

Offline amwebby

  • Community Suite Customer
  • Sr. Member
  • ******
  • Posts: 306
    • View Profile
Place ads in a stand alone php file?
« on: January 25, 2013, 06:30:39 am »
I have successfully integrate adverts into my Joomla site using SSI.php, by creating a Joomal module and loading that into a module position via my template

My current problem is I want to incorporate that module in a page. The way to do this in Joomla is to use {mosloadposition userposition} to load the module within a page. Unfortunately mosloadposition doesn't play nice with SSI and I just get a blank page.

I'm thinking of creating the page as a php file and loading that using a wrapper. Do you have one you made earlier or a template I might use to do this?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Place ads in a stand alone php file?
« Reply #1 on: January 25, 2013, 07:27:51 am »
Quote
I'm thinking of creating the page as a php file and loading that using a wrapper.

That's exactly what to do.

Create a new php file in your forum directory

Code: [Select]
<?php
require 'SSI.php';

// Begin Ad Seller Pro Location - Overall Footer

global $sourcedir;
include_once 
$sourcedir "/adseller.php";

$adSellerAdData =  ShowAdLocation(2);

// Check if any ads where found
if ($adSellerAdData != false)
{
// Dispaly the advertising code
echo $adSellerAdData;
}

// End Ad Seller Pro Location - Overall Footer

?>




And that's it.

You can then either link to the file or call the file using an iframe. I like the iframe route the best.
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 amwebby

  • Community Suite Customer
  • Sr. Member
  • ******
  • Posts: 306
    • View Profile
Re: Place ads in a stand alone php file?
« Reply #2 on: January 25, 2013, 07:37:20 am »
Thanks. That worked perfectly once I'd changed the permissions on the file to 755. A Joomla wrapper is an iframe so I'm almost all set.

Offline amwebby

  • Community Suite Customer
  • Sr. Member
  • ******
  • Posts: 306
    • View Profile
Re: Place ads in a stand alone php file?
« Reply #3 on: January 27, 2013, 04:53:51 am »
Thanks to your help I've got that working fine. You can see it at: http://www.amoc.org/component/option,com_wrapper/Itemid,904/

My problem now is I want to put a div behind each ad that appears to highlight it but my php knowledge is limited and I can't figure out how to do that. Help?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Place ads in a stand alone php file?
« Reply #4 on: January 27, 2013, 09:39:36 am »
 On each ad unit? Or for the entire location overall?
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 amwebby

  • Community Suite Customer
  • Sr. Member
  • ******
  • Posts: 306
    • View Profile
Re: Place ads in a stand alone php file?
« Reply #5 on: January 27, 2013, 09:41:30 am »
Only in this php file. No where else.

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
4394 Views
Last post September 21, 2007, 04:10:47 pm
by cthunder
3 Replies
7236 Views
Last post March 19, 2008, 07:29:52 pm
by SMFHacks
4 Replies
5745 Views
Last post November 04, 2009, 07:57:21 pm
by Ghostwalker
2 Replies
3244 Views
Last post November 21, 2010, 03:35:56 am
by wandawill
2 Replies
3001 Views
Last post June 19, 2011, 10:21:45 am
by bruno

+- 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