Posted on: 05/18/06 12:31pm
By: garfy
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
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/18/06 01:11pm
By: trinity
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.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/18/06 01:24pm
By: garfy
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';
?>
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/18/06 03:40pm
By: beewee
You could make an I-frame with this source:
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.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/18/06 04:12pm
By: garfy
how to do that
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/19/06 06:59am
By: Anonymous (beewee)
<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.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/19/06 09:23pm
By: garfy
they told me i shhould no t use iframe
doesnt anybody know why the code is not working??
Dirk where r u?
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/19/06 09:54pm
By: machinari
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.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/20/06 03:38am
By: garfy
but what to put in the field for calling the function
please help
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 02:45pm
By: garfy
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
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 02:57pm
By: garfy
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
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 04:19pm
By: machinari
your problem is syntax.. try this in your lib custom:
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';
}
}
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 04:22pm
By: machinari
why do you have this issue being discussed in two different threads?
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 04:40pm
By: garfy
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.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 05:51pm
By: machinari
ensure that you have not deleted the ?> , which should be that very last thing in that file.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 06:08pm
By: garfy
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??
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 06:21pm
By: machinari
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.
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 06:28pm
By: garfy
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';
}
}
?>
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 06:50pm
By: machinari
put a $ before the word "timeout."
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/21/06 07:01pm
By: garfy
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
How to use code php for showing banners in geeklog? URGENT please
Posted on: 05/22/06 07:31pm
By: Anonymous (garfy)
doesnt really anybody know
Dirk? Machinari?