Jump to content

need help with code in admin header?


thehost5968

Recommended Posts

Hi

 

I need to added this bite of code to the ADMIN header somewhere between <head></head> but it is php here is the code:

 

<?php
check_for_settings();
if(  isset($_GET['refresh']) && is_numeric($_GET['refresh']) ){
 $query = 'refresh='. $_GET['refresh'];
 if(  isset($_GET['show']) ) {
   if ( $_GET['show'] == 'all' || $_GET['show'] == 'bots' || $_GET['show'] == 'guests' ){
      $query .= '&show='. $_GET['show'];
   }
 }
if(  isset($_GET['bots']) &&  $_GET['bots'] == 'show') {
   $query .= '&bots=show';
}
 echo '<meta http-equiv="refresh" content="' . $_GET['refresh'] . ';URL=' . $C['filename_whos_online'] . '?' . $query . '" />
 ';
}
?>

 

I have tried just this code and also {php}this code{/php} but all I get is the header background and no page showing.

 

So what am I doing wrong.

 

Thanks

 

Simon

Link to comment
Share on other sites

Did you tried it like

 

{php}
check_for_settings();
if(  isset($_GET['refresh']) && is_numeric($_GET['refresh']) ){
 $query = 'refresh='. $_GET['refresh'];
 if(  isset($_GET['show']) ) {
   if ( $_GET['show'] == 'all' || $_GET['show'] == 'bots' || $_GET['show'] == 'guests' ){
      $query .= '&show='. $_GET['show'];
   }
 }
if(  isset($_GET['bots']) &&  $_GET['bots'] == 'show') {
   $query .= '&bots=show';
}
 echo '<meta http-equiv="refresh" content="' . $_GET['refresh'] . ';URL=' . $C['filename_whos_online'] . '?' . $query . '" />
 ';
}
{/php}

Link to comment
Share on other sites

this is the <header></header> part of the page:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<title>WHMCS - {$pagetitle}</title>
<link href="templates/v4/style.css" rel="stylesheet" type="text/css" />
<link href="../includes/jscript/css/ui.all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../includes/jscript/jquery.js"></script>
<script type="text/javascript" src="../includes/jscript/jqueryui.js"></script>
<script type="text/javascript" src="../includes/jscript/adminmenu.js"></script>
<script type="text/javascript" src="../includes/jscript/adminsearchbox.js"></script>
{literal}
<script type="text/javascript" language="JavaScript">
<!--
function who_is(query) {
 var whoisurl = '<?php echo $C['whois_url'] ?>' + query;
 window.open(whoisurl,"who_is_lookup","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
}
//-->
</script>

<script>
 $(document).ready(function(){
    $("#intellisearchval").keyup(function () {
       var intellisearchlength = $("#intellisearchval").val().length;
       if (intellisearchlength>2) {
       $.post("search.php", { intellisearch: "true", value: $("#intellisearchval").val() },
         function(data){
           $("#searchresults").html(data);
           $("#searchresults").slideDown("slow");
         });
       }
   });
   $("#intellisearchcancel").click(function () {
       $("#intellisearchval").val("");
       $("#searchresults").slideUp("slow");
   });
   $(".datepick").datepicker({
       dateFormat: "{/literal}{$datepickerformat}{literal}",
       showOn: "button",
       buttonImage: "images/showcalendar.gif",
       buttonImageOnly: true,
       showButtonPanel: true
   });
   {/literal}{$jquerycode}{literal}
 });{/literal}
 {$jscode}
</script>
<script type="text/javascript" src="../includes/jscript/password_generator.js"></script>
<script type="text/javascript">
// Hook AddGeneratePasswordButton to window load
addEvent(window,'load',AddGeneratePasswordButton);
</script>
{php}
check_for_settings();
if(  isset($_GET['refresh']) && is_numeric($_GET['refresh']) ){
 $query = 'refresh='. $_GET['refresh'];
 if(  isset($_GET['show']) ) {
   if ( $_GET['show'] == 'all' || $_GET['show'] == 'bots' || $_GET['show'] == 'guests' ){
      $query .= '&show='. $_GET['show'];
   }
 }
if(  isset($_GET['bots']) &&  $_GET['bots'] == 'show') {
   $query .= '&bots=show';
}
 echo '<meta http-equiv="refresh" content="' . $_GET['refresh'] . ';URL=' . $C['filename_whos_online'] . '?' . $query . '" />
 ';
}
{/php} 
</head>

 

if that helps

Link to comment
Share on other sites

OK where on this forum can I post to see if I can hire someone to get this working or can that not be done on this forum?

Not allowed, sorry.

 

Where is "check_for_settings();" defined? If I have a normal php page with just your php in it, it errors out asking for it.

Link to comment
Share on other sites

good Q

I did not see that.

 

That is why I need to p somesone to get this working.

 

what it is I have a whos-online script that I need coding in to a admin add-on mod or report and I have been trying to get it working for about 5 day know.

Edited by thehost5968
Link to comment
Share on other sites

I'd agree, but Matt doesn't want this to become that sort of forum. You can open a ticket to ask about custom coding or assistance, or post at a coding or similar forum.

 

In looking at the code you provided, you jump out of the {literal} tags several times to have what appear to be PHP vars parsed/run, but it's not within {php} or even <?php tags unless I've missed something. Little wonder they won't be parsed.

Link to comment
Share on other sites

just compared my header with fresh one and it is only this....do you now how I should replace the above code.

<?php echo $C['whois_url'] ?>

 

{php} echo $C['whois_url']; {/php}

(note also the addition of the ";" at the end which was missing in yours)

 

As for the database call, once per page should work, but with all the jumping in and out of scope you might have problems.

Link to comment
Share on other sites

  • 2 weeks later...
How come anytime I try to add just HTML to the header I get that blank white page. I want to add my site header to the script just plain HTML

 

Please do not post a question then not reply in a open thread as all the others that have post's in the thread may drop what they are doing to try and help to just waste there time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated