0 Members and 1 Guest are viewing this topic.

*

irondutchess

  • *
  • 43
    • Date 'n' Meet
  • osDate Version: osDate v2.7
Adding content between the <head> & </head> tags.
« on: June 03, 2016, 08:09:32 PM »
Which file would need to be edited to add content to the <head> tag, such as say meta tags etc?

*

Pharg

  • *****
  • 3,147
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Adding content between the <head> & </head> tags.
« Reply #1 on: June 03, 2016, 10:53:01 PM »
Hi Chris,

Meta tags go into the index_header.tpl file
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

havana

  • *
  • 15
  • Non profit - community work.
  • osDate Version: osDate Evo v1.0
Re: Adding content between the <head> & </head> tags.
« Reply #2 on: July 24, 2016, 04:00:09 PM »
Hi,

Could this also the place where in need to add the google analytics code?

*

Pharg

  • *****
  • 3,147
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Adding content between the <head> & </head> tags.
« Reply #3 on: July 24, 2016, 10:26:36 PM »
Hi havana,

That would be better in either the index.tpl close to the bottom or the footer.tpl.

When putting in the script like that, you will have to use {literal} {/literal} tags around the JavaScript.

Example:
Quote
{literal}<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_slot = "3467055370";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>{/literal}
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

havana

  • *
  • 15
  • Non profit - community work.
  • osDate Version: osDate Evo v1.0
Re: Adding content between the <head> & </head> tags.
« Reply #4 on: July 25, 2016, 09:06:07 AM »
No sure if it works. I added the analytics code in the bottom of index.tpl. My code looks like this.

Code: [Select]
{include file="index_header.tpl"}
{strip}
<body dir="{lang mkey='DIRECTION'}">
<center>
<!-- Header portion  -->

<div class="main_outer_table">
         <div class="big_search">
          {include file="loginbar.tpl"}
           </div>
         <div class="small_search">
          {include file="loginbar_min.tpl"}
           </div>
       {if $smarty.session.UserId != ''}
       <table width="100%" border="0" cellpadding="0" cellspacing="0" class="headbginside">
      <tr>
  <td style="width:100%;">
        <div>
          {include file="logo_inside.tpl"}
        </div>
           </td>
      </tr>
     </table>
      {else}
       <table width="100%" border="0" cellpadding="0" cellspacing="0" class="headbgtitle">
      <tr>
  <td style="width:100%;">
        <div>
          {include file="logo.tpl"}
        </div>
           </td>
      </tr>
     </table>
     {/if}
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
  <td style="width:100%;">
     <div class="headbgbox">
        <div class="big_search">
{include file="searchprofile.tpl"}
</div>
            <div class="small_search">
{include file="searchprofile_min.tpl"}
</div>
            </div>
       {if $smarty.session.UserId != ''}
        <div class="dropdownbgbox">
           <div class="big_menu">
{if $config.menutype == 'top' && $smarty.session.UserId != ''}
{include file="dropdownpanelmenu_big.tpl"}   
   {/if}
</div>
               </div>
        <div class="dropdownbgbox">
           <div class="small_menu">
{if $config.menutype == 'top' && $smarty.session.UserId != ''}
{include file="dropdownpanelmenu_mid.tpl"}   
   {/if}
</div>
              </div>
        {/if}
          </td>
      </tr>
     </table>
     


                 <!-- Leftside Column   -->
<div style="margin-top: 2px; width:100%;">
<div class="leftcolumn">
{include file="leftcolumn.tpl"}
</div>
<div class="user_menu">
{include file="user_menu.tpl"}
</div>
      </div>
     <div id="backtop">&#9650;</div>
      <div id="backtop" data-v-w="300, 1200">&#9650;</div>
<!-- Rendered page -->
<div class="page">
{$rendered_page}
        <br />
{$modosdate_main}
<br />
          {include file="banner_mainpage.tpl"}
              <br />
             <br />
        </div>


   
    <div id="backtop" data-v-w="300, 1200">&#9650;</div>
<!--  Footer   -->
<div style="clear:both; text-align:center; width:100%;">
{include file="footer.tpl"}
</div>
</div>
</center>
{literal}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
var jq172 = jQuery.noConflict();
</script>
{/literal}
<script type="text/javascript">
updateOnlineTime();
{if $smarty.session.UserId <= 0}
updateOnlineCount();
{/if}
</script>
</body>
</html>
{closedb}
{/strip}

{literal}<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'XX-XXXXXXXX-X', 'auto');
  ga('send', 'pageview');

</script>{/literal}

When visiting the site myself, i should see realtime traffic incomming. But is see none, therefore i am not sure the i implemented the code in the right way.?

*

Pharg

  • *****
  • 3,147
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Adding content between the <head> & </head> tags.
« Reply #5 on: July 25, 2016, 09:14:24 AM »
Hi havana,

Looks ok to me and it should be working fine.
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

havana

  • *
  • 15
  • Non profit - community work.
  • osDate Version: osDate Evo v1.0
Re: Adding content between the <head> & </head> tags.
« Reply #6 on: July 25, 2016, 09:27:42 AM »
Nope, i got zero incomming traffic. I tested with serveral (differnet IP) devices.

*

Pharg

  • *****
  • 3,147
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Adding content between the <head> & </head> tags.
« Reply #7 on: July 25, 2016, 09:36:30 AM »
Hi havana,

It's a new google analytics account, it wont work straight away.

Try putting it above the closing /Body tag
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

havana

  • *
  • 15
  • Non profit - community work.
  • osDate Version: osDate Evo v1.0
Re: Adding content between the <head> & </head> tags.
« Reply #8 on: July 25, 2016, 09:42:05 AM »
Solved.

Made my edit op index.tpl in the wrong template dir. Now it is working. Both google analytics as the hiding for the users for not registred users.

 :D

*

Pharg

  • *****
  • 3,147
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Adding content between the <head> & </head> tags.
« Reply #9 on: July 25, 2016, 10:34:46 AM »
Hi havana,

Great one, I thought you might be doing that :)
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35