News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Hardcode footer help

Started by VacationCancun, September 01, 2008, 12:30:30 PM

Previous topic - Next topic

VacationCancun

Hi,

I have some difficult code to try to insert and I would like to ask for help. I cannot use any mods or modules for this particular PHP, not in SMF and not in Joomla.

Here is where I need to put it. (Pls scroll down).
<table id="footersection" cellpadding="0" cellspacing="0" width="100%">';

// Show the load time?
if ($context['show_load_time'])
echo '
<tr>
<td class="borderline">
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>
</td>
</tr>';

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<tr>
<td class="whitetext" align="center"><span class="smalltext">', theme_copyright(), ' <br />
<strong>Leviathan</strong> design by <a href="http://www.tinyportal.net">Bloc</a> |
<a href="http://validator.w3.org/check/referer" target="_blank">XHTML</a> |
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">CSS</a>
</span>
</td>
</tr>
</table>';

/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
// Begin My Code
echo '
      <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;" class="windowbg">
         <tr>
            <td class="whitetext" align="center"><span class="smalltext" valign="top" width="85%" height="100%">
               <div style="overflow: auto; width: 100%;" align="center">
/////////////////////////////////////////////////////////
==========My PHP Code==========
/////////////////////////////////////////////////////////
               </div>
            </td>
         </tr>
      </table>
';
// End of My Code
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////

echo '

</div>';


Here's the code I need to put in:
<?php

$OpenInNewWindow
= "1";

// ********************************************************************
// Please DO NOT modify anything below
// ********************************************************************

$BLKey = "Y7T5-DFR0-3333";

$QueryString  = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&Key=" .urlencode($BLKey);
$QueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);

if(
intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
   @
readfile("http://www.remotesite.com/engine.php?".$QueryString);
}
elseif(
intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
   if(
$content = @file("http://www.remotesite.com/engine.php?".$QueryString))
       print @
join('', $content);
}
elseif(
function_exists('curl_init')) {
   
$ch = curl_init ("http://www.remotesite.com/engine.php?".$QueryString);
   
curl_setopt ($ch, CURLOPT_HEADER, 0);
   
curl_exec ($ch);

   if(
curl_error($ch))
       print
"Error processing request";

   
curl_close ($ch);
}
else {
   print
"It appears that your web host has disabled all functions for handling remote pages and as a result the software will not function on your web page. Please contact your web host for more information.";
}
?>


I would really appreciate some help with this, I have been working on it and just can't get it.

Thank you,

VC

H

Welcome to SMF.
Try something like:


  <table id="footersection" cellpadding="0" cellspacing="0" width="100%">';

   // Show the load time?
   if ($context['show_load_time'])
      echo '
      <tr>
         <td class="borderline">
            <span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>
         </td>
      </tr>';

   // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
   echo '
      <tr>
            <td class="whitetext" align="center"><span class="smalltext">', theme_copyright(), ' <br />
            <strong>Leviathan</strong> design by <a href="http://www.tinyportal.net">Bloc</a> |
               <a href="http://validator.w3.org/check/referer" target="_blank">XHTML</a> |
               <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">CSS</a>
            </span>
         </td>
      </tr>
   </table>';

/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
// Begin My Code
echo '
      <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;" class="windowbg">
         <tr>
            <td class="whitetext" align="center"><span class="smalltext" valign="top" width="85%" height="100%">
               <div style="overflow: auto; width: 100%;" align="center">';
$OpenInNewWindow = "1";

// ********************************************************************
// Please DO NOT modify anything below
// ********************************************************************

$BLKey = "Y7T5-DFR0-3333";

$QueryString  = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&Key=" .urlencode($BLKey);
$QueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);

if(intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
    @readfile("http://www.remotesite.com/engine.php?".$QueryString);
}
elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
    if($content = @file("http://www.remotesite.com/engine.php?".$QueryString))
        print @join('', $content);
}
elseif(function_exists('curl_init')) {
    $ch = curl_init ("http://www.remotesite.com/engine.php?".$QueryString);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_exec ($ch);

    if(curl_error($ch))
        print "Error processing request";

    curl_close ($ch);
}
else {
    print "It appears that your web host has disabled all functions for handling remote pages and as a result the software will not function on your web page. Please contact your web host for more information.";
}
echo'
               </div>
            </td>
         </tr>
      </table>
';
// End of My Code
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////

   echo '

   </div>';


I don't know what code is being called by your php so you could still run into problems.
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

VacationCancun

Hey, thank you. I will look at it and try it when I get back.

If you know what code is being called, it is a remote backlink sponsor. I can put it on a normal blank static php page and show you if you want to see it.

This particular piece of code is real fussy due to their (the remote) config.

Thanks again,

VC

H

QuoteHey, thank you. I will look at it and try it when I get back.

Ok, let us know if it works :). It should do unless I made an error or the code that is returned breaks the layout.

If there are any alternative advertising programs you'd probably be better off using them as currently the page load will be slowed if the remote server you're contacting is down
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

esforum

Hello,
I would like to ask you, which file contains the footer copyright .

Thank you

H

-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

VacationCancun

Quote from: H on September 02, 2008, 06:12:27 AM
Ok, let us know if it works :). It should do unless I made an error or the code that is returned breaks the layout.

If there are any alternative advertising programs you'd probably be better off using them as currently the page load will be slowed if the remote server you're contacting is down
Hey man, it works beautifully! Thank you!
I'm 'ok' with .php but you rock bro, very nice work.

Sorry I didn't come back earlier to report on this, I just got off my lazy arse this morning and got it done, LOL

Thanks again!

VC

H

-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Advertisement: