Welcome to Geeklog, Anonymous Friday, November 08 2024 @ 09:47 pm EST

Geeklog Forums

How to use code php for showing banners in geeklog? URGENT please

Page navigation


Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
I got the code from one costumer and it is like this

$fp = @fsockopen("www.linkworth.com", "80",$errno, $errstr, $timeout="5");
if($fp)
{
require 'http://www.link.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=51&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1';
}
?>



i tried to put the code into right block and doesnpot work

i also tried to put it in footer

They also gave the code for ASP page, CFM page or perl page if the php will not work

can someone tell me what to do please

thank you
 Quote

Status: offline

trinity

Forum User
Regular Poster
Registered: 01/30/05
Posts: 80
where are you trying to place this? The way there code is writen its checking the site via fsock and trying to include a remote file. i would want to know what the remote file is and what it contains. if it has php code in it you need to know that. if its raw html it wont display in a php block unless its echoed. If you try and include this in a html block or in a template file other than header.thtml in your theme it will fail as well. You need to ask questions on the tech underlying the advertizeing system they are useing or at the verry least probe around for info.

The link its trying to include is bad and i get 404. I tried editing it to be the same domain as the fsock call and it returns a table with nothing in it. you will find that five times out of ten your average afiliate banner advertizer dosent know anything about php and how there system worls. send me some of the other code samples for other langs so i can look at them.
glFusion - Technology Fused with Style - www.gllabs.org
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
sorry for the code here it is

$fp = @fsockopen("www.linkworth.com", "80",$errno, $errstr, $timeout="5");
if($fp)
{
require 'http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1';
}
?>


they just told me to put this code so i will have a rotating add on my site and they also gave me the asp aa and rss code for the same rotating ad if i can not use the php code

i would like to put the banner in the footer or on the right block probably

i do not know what the remote file is all they give me is this code

the asp they gave me is like this




Dim objXMLHTTP, strRetVal, strHTML
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", "http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1", False
objXMLHTTP.Send
response.write objXMLHTTP.responseText
set objXMLHTTP = Nothing
%>


and the rss code is this

require 'http://www.linkworth.com/act/partner/rotating_ads/rss_feed.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604';
?>
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
You could make an I-frame with this source:

Text Formatted Code
http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1
 


And you can put that I-frame anywhere you like.

Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
how to do that
 Quote

beewee

Anonymous
Text Formatted Code
<iframe
src="http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1"
width="100%">
</iframe>
 


Look at W3schools.com for more info about the borders etc.
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
they told me i shhould no t use iframe

doesnt anybody know why the code is not working??

Dirk where r u?
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
put your php code into a phpblock_functionName and place it into your lib-custom.

then create a php block using the name of your new function.
The code works fine. the only problem you may have is the require will put the add/link above your header and I dunno how to solve that off the top of my head.

Otherwize it works fine.
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
but what to put in the field for calling the function

please help
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
i can not find the lib custom, in which folder is it??

and how to name the code for example phpblock_banner

hot to use the banner name with the code in lib custom
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
ok i found the lib custom and i inserted this code in the bottom




function phpblock_banner ()
{

$fp = @fsockopen("www.linkworth.com", "80",$errno, $errstr, $timeout="5");
if($fp)
{
require 'http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1';
}
?>
}





and then i add the new block and select php block and put

phpblock_banner in the block function
i leave empty all the other fields
i saved and on the first page where the ad should show i get this

Error in PHP Block. Function, phpblock_banner, does not exist.

can you please tell me what is wrong
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
your problem is syntax.. try this in your lib custom:
Text Formatted Code

function phpblock_banner()
{
    $fp = @fsockopen("www.linkworth.com", "80",$errno, $errstr, $timeout="5");
    if($fp) {
        require 'http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1';
    }
}

 
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
why do you have this issue being discussed in two different threads?
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
sorry for two posts but i didnt receive the answer so i posted again

i tried your code but it is the same as i had before

it doesn not work

i stil get this

Error in PHP Block. Function, phpblock_banner, does not exist.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
ensure that you have not deleted the ?> , which should be that very last thing in that file.
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
thank you for help

here is the last few rows of the lib custom



* This is an example of a function that returns menu entries to be used for
* the 'custom' entry in $_CONF['menu_elements'] (see config.php).
*
*/
/*
function CUSTOM_menuEntries ()
{
global $_CONF, $_USER;

$myentries = array ();

// Sample link #1: Link to Gallery
$myentries[] = array ('url' => $_CONF['site_url'] . '/gallery/',
'label' => 'Gallery');

// Sample link #2: Link to the Personal Calendar - only visible for
// logged-in users
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url']
. '/calendar.php?mode=personal',
'label' => 'My Calendar');
}

return $myentries;
}





function phpblock_banner()
{
$fp = @fsockopen("www.linkworth.com", "80",$errno, $errstr, timeout="5");
if($fp) {
require 'http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1';
}
}



*/

?>



can you tell me what is wrong??
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
move the */ , which is near the bottom, and place it before the last function. Currently it is causing your last function to be commented out.
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
if i do that i get the error

Parse error: parse error, unexpected '=' in /home/altermed/system/lib-custom.php on line 449

the code look s now like that




/**
* This is an example of a function that returns menu entries to be used for
* the 'custom' entry in $_CONF['menu_elements'] (see config.php).
*
*/
/*
function CUSTOM_menuEntries ()
{
global $_CONF, $_USER;

$myentries = array ();

// Sample link #1: Link to Gallery
$myentries[] = array ('url' => $_CONF['site_url'] . '/gallery/',
'label' => 'Gallery');

// Sample link #2: Link to the Personal Calendar - only visible for
// logged-in users
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url']
. '/calendar.php?mode=personal',
'label' => 'My Calendar');
}

return $myentries;
}


*/


function phpblock_banner()
{

$fp = @fsockopen("www.linkworth.com", "80",$errno, $errstr, timeout="5");
if($fp) {
require 'http://www.linkworth.com/act/partner/rotating_ads/inclusion_links.php?prt_website_id=5128&prt_website_link_placement_location=3&prt_website_link_placement_id=10604&link_format=1';
}
}






?>


 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
put a $ before the word "timeout."
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
i did and nothing works

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/altermed/system/lib-custom.php on line 453

i get this error now
 Quote

Page navigation

All times are EST. The time is now 09:47 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content