News:

Wondering if this will always be free?  See why free is better.

Main Menu

script help please

Started by Saver One, February 13, 2009, 09:00:41 PM

Previous topic - Next topic

Saver One


Hello.

I have a couponing website hxxp:www.artofcouponing.com [nonactive] I am currently using v.2.0 beta 4 and the "impulse" theme.

I have become an affiliate of hxxp:coupons.com [nonactive] to be able to put either a skyscraper or vertical bar on my pages that will show pictures of coupons and when clicked will open up their website for my members to print.

Coupons.com has given me a script and told me to add it to my pages, but that's where I'm lost.  I don't know where I need to put the script.

I would like to use the skyscraper bar preferably, and would like to put it on each page..to the far left in the empty area...and possibly another one near the top where it says "from the news" in that blank area.

here's what the script says that they've given me

<script language="javascript" type="text/javascript">
var ci_cap_scriptId = "6491";
var ci_cap_bid = "1052890001";
var ci_cap_format = "120x600";
</script>
<script language="javascript" type="text/javascript" src="hxxp:bc.coupons.com/ [nonactive]"></script>

Marcus Forsberg

Could you please attach index.template.php, lcoated in ./Themes/impulse/

Saver One

#2
<?php
// Version: 2.0 Beta 4; index

/*   This template is, perhaps, the most important template in the theme. It
   contains the main template layer that displays the header and footer of
   the forum, namely with main_above and main_below. It also contains the
   menu sub template, which appropriately displays the menu; the init sub
   template, which is there to set the theme up; (init can be missing.) and
   the linktree sub template, which sorts out the link tree.

   The init sub template should load any data and set any hardcoded options.

   The main_above sub template is what is shown above the main content, and
   should contain anything that should be shown up there.

   The main_below sub template, conversely, is shown after the main content.
   It should probably contain the copyright statement and some other things.

   The linktree sub template should display the link tree, using the data
   in the $context['linktree'] variable.

   The menu sub template should display all the relevant buttons the user
   wants and or needs.

   For more information on the templating system, please see the site at:
   http://www.simplemachines.org/
*/

starting on line 29

// Initialize the template... mainly little settings.
function template_init()
{
   global 
$modSettings,$context$settings$options$txt$boarddir;

   
/* Use images from default theme when using templates from the default theme?
      if this is 'always', images from the default theme will be used.
      if this is 'defaults', images from the default theme will only be used with default templates.
      if this is 'never' or isn't set at all, images from the default theme will not be used. */
   
$settings['use_default_images'] = 'never';

   
/* What document type definition is being used? (for font size and other issues.)
      'xhtml' for an XHTML 1.0 document type definition.
      'html' for an HTML 4.01 document type definition. */
   
$settings['doctype'] = 'xhtml';

   
/* The version this template/theme is for.
      This should probably be the version of SMF it was created for. */
   
$settings['theme_version'] = '2.0 Beta 4';

   
/* Set a setting that tells the theme that it can render the tabs. */
   
$settings['use_tabs'] = true;

   
/* Use plain buttons - as oppossed to text buttons? */
   
$settings['use_buttons'] = true;

   
/* Show sticky and lock status separate from topic icons? */
   
$settings['separate_sticky_lock'] = true;
   
/* Does this theme use the strict doctype? */
   
$settings['strict_doctype'] = false;

   
/* Does this theme use post previews on the message index? */
   
$settings['message_index_preview'] = false;

   
// load custom language strings
   
if(loadLanguage('ThemeStrings') == false)
      
loadLanguage('ThemeStrings''english');
   
   
$context['theme_credit']='imPulse';
   
// make sure undefined actions use their own template
   
$settings['catch_action'] = array('layers' => array('main','pages'));
   
   if(
$context['browser']['is_ie6'])
      
loadtemplate('ie6');
}

beginning line 75

// any special pages?
function template_pages_above()
{
   global 
$context$settings$options$scripturl$txt;
   
   echo 
'<div id="pages">';
   if(isset(
$_GET['action']))
      
$what=$_GET['action'];

   if(
file_exists($settings['theme_dir'] . '/pages/' $what'.template.php'))
      
loadtemplate('pages/'.$what);
   else
      
loadtemplate('pages/blank');
}

beginning line 95

// The main sub template above the content.
function template_main_above()
{
   global 
$context;

   if(
$context['browser']['is_ie5'] || $context['browser']['is_ie5.5'])
      
$context['browser']['is_ie6']=true;
   if(
$context['browser']['is_ie6'])
      
template_ie6_above();
   else
      
template_default_above();
}

beginning line 107

function template_default_above()
{
   global 
$context$settings$options$scripturl$txt$modSettings;

   if(
$context['page_title']=='' && isset($_GET['action']))
      
$context['page_title']=$context['forum_name'].' - '.$_GET['action'];
   elseif(
$context['page_title']=='' && !isset($_GET['action']))
      
$context['page_title']=$context['forum_name'];

   
// Show right to left and the character set for ease of translating.
   
echo '<!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"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
   <meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
   <meta name="description" content="'
$context['page_title_html_safe'], '" />
   <meta name="keywords" content="'
$context['meta_keywords'], '" />
   <script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/script.js?b4"></script>
   <script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/theme.js?b4"></script>
   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      var smf_theme_url = "'
$settings['theme_url'], '";
      var smf_default_theme_url = "'
$settings['default_theme_url'], '";
      var smf_images_url = "'
$settings['images_url'], '";
      var smf_scripturl = "'
$scripturl'";
      var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
      var smf_charset = "'
$context['character_set'], '";'$context['show_pm_popup'] ? '
      if (confirm("' 
$txt['show_personal_messages'] . '"))
         window.open("' 
$scripturl '?action=pm");' '''
      var ajax_notification_text = "'
$txt['ajax_in_progress'], '";
      var ajax_notification_cancel_text = "'
$txt['modify_cancel'], '";
   // ]]></script>
   <title>'
$context['page_title_html_safe'], '</title>';

   
// Please don't index these Mr Robot.
   
if (!empty($context['robot_no_index']))
      echo 
'
   <meta name="robots" content="noindex" />'
;

   
// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
   
echo '
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />
   <link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';


   
// theme css
   
echo '
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/impulse.css?fin11" />';

   if(
$context['browser']['is_ie6'])
      echo 
'
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/ie6.css?fin11" />';

   if(
$context['browser']['is_ie7'])
      echo 
'
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/ie7.css?fin11" />';

   
// Show all the relative links, such as help, search, contents, and the like.
   
echo '
   <link rel="help" href="'
$scripturl'?action=help" />
   <link rel="search" href="' 
$scripturl '?action=search" />
   <link rel="contents" href="'
$scripturl'" />';

   
// If RSS feeds are enabled, advertise the presence of one.
   
if (!empty($modSettings['xmlnews_enable']))
      echo 
'
   <link rel="alternate" type="application/rss+xml" title="'
$context['forum_name_html_safe'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

   
// If we're viewing a topic, these should be the previous and next topics, respectively.
   
if (!empty($context['current_topic']))
      echo 
'
   <link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
   <link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

   
// If we're in a board, or a topic for that matter, the index will be the board's index.
   
if (!empty($context['current_board']))
      echo 
'
   <link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

   
// We'll have to use the cookie to remember the header...
   
if ($context['user']['is_guest'])
      
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

   
// Output any remaining HTML headers. (from mods, maybe?)
   
echo $context['html_headers'], '

   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

      function shrinkHeader(mode)
      {'
;

   
// Guests don't have theme options!!
   
if ($context['user']['is_guest'])
      echo 
'
         document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
   else
      echo 
'
         smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

   echo 
'
         document.getElementById("upshrink").src = "'
$settings['theme_url'],'/theme" + (mode ? "/user2.png" : "/user.png");

         document.getElementById("userbox").style.display = mode ? "none" : "";
         current_header = mode;
      }

   // ]]></script>'
;

   
// the routine for the info center upshrink
   
echo '
      <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
         var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

         function shrinkHeaderIC(mode)
         {'
;

   if (
$context['user']['is_guest'])
      echo 
'
            document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
   else
      echo 
'
            smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

   echo 
'
            document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

            document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

            current_header_ic = mode;
         }
      // ]]></script>
</head>
<body>'
;

   echo 
'
<div id="mainarea">
   <div id="topsection">'
;

   if (empty(
$settings['header_logo_url']))
      echo 
'
      <h1 id="mainheader"><a href="' 
$scripturl '">'$context['forum_name'], '</a></h1>';
   else
      echo 
'
      <a href="' 
$scripturl '"><img id="mainheader" src="'$settings['header_logo_url'], '" alt="'$context['forum_name'], '" /></a>';
   
   echo 
'
      <div id="muser">
         <a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['theme_url'], '/theme/', empty($options['collapse_header']) ? 'user.png' 'user2.png''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
         <div id="userbox" class="content"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>';
   if(
$context['user']['is_logged'])
   {
      echo 
'<b>'$txt['hello_member_ndt'], ' '$context['user']['name'] , '</b>
            <br />'
;
      if (
$context['allow_pm'])
         echo 
$txt['msg_alert_you_have'], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
      echo 
'.<br />';
      
      echo 
'
            <a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
            <a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

      
// Is the forum in maintenance mode?
      
if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo 
'
            <b>'
$txt['maintain_mode_on'], '</b><br />';

      
// Are there any members waiting for approval?
      
if (!empty($context['unapproved_members']))
         echo 
'<br />
                        '
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=action=admin;area=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

      if (!empty(
$context['open_mod_reports']) && $context['show_open_reports'])
         echo 
'
                        <a href="'
$scripturl'?action=moderate;area=reports">'sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a><br />';
   }
   else
   {
      echo 
'   
            <script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>
            <form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" class="middletext" style="text-align: center;margin: 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
               <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
               <select name="cookielength">
                  <option value="60">'
$txt['one_hour'], '</option>
                  <option value="1440">'
$txt['one_day'], '</option>
                  <option value="10080">'
$txt['one_week'], '</option>
                  <option value="43200">'
$txt['one_month'], '</option>
                  <option value="-1" selected="selected">'
$txt['forever'], '</option>
               </select><br />
               <input type="submit" value="'
$txt['login'], '" /><br />
               '
$txt['quick_login_dec'];

      if (!empty(
$modSettings['enableOpenID']))
         echo
'
               <br />
               <input type="text" name="openid_url" id="openid_url" size="25" class="openid_login" />'
;

      echo 
'
               <input type="hidden" name="hash_passwrd" value="" />
            </form>'
;
   }
   if (!empty(
$context['user']['avatar']))
      echo 
'
            <div id="myavatar">'
$context['user']['avatar']['image'], '</div>';

   echo 
'
         </div>
         <span class="footer"></span>
      </div>
   </div>
   <div id="topsection2">
      <span class="left"></span>
      <span class="right"></span>
      <div class="content">
      </div>
   </div>
   <div id="topsection3">
      <span class="left"></span>
      <span class="right"></span>
      <div class="content"></div>
   </div>
   <div id="topmiddle">
      <div class="left">
         <div class="right">
            <div class="content">
               <h3 id="news">' 
$txt['impulse_newsline'] , '</h3>
               ' 
$context['random_news_line'] , '
            </div>
         </div>
      </div>
   </div>
   <div id="middlesection">
      <span class="left"></span>
      <span class="right"></span>
      <div class="content"><div id="menudiv">'
template_menu(), '</div></div>
   </div>
   <div id="content">
      <div class="inner">
         <div class="mid">'
;

   
// for TP 0.9.8
   
if(!empty($context['TPortal']['version']) && $context['TPortal']['version']=='098')
      
tpcode();

}

beginning line 350

function template_main_below()
{
   global 
$context;

   
// decide...
   
if($context['browser']['is_ie6'])
      
template_ie6_below();
   else
      
template_default_below();

}

beginning line 362

function template_default_below()
{
   global 
$context$settings$options$scripturl$txt;

   echo 
'<br style="clear: both;" />';
      
// for TP 0.9.8
   
if(!empty($context['TPortal']['version']) && $context['TPortal']['version']=='098')
      
tpcode2();

   echo 
'
         </div>
      </div>
   </div>
   <div id="footersection">
      <span class="left"></span>
      <span class="right"></span>
      <div class="content"><div id="copywrite">' 
theme_copyright() , function_exists('tportal_version') ? '<div>' tportal_version() . '</div>' '' '<br /><strong>imPulse</strong> theme by <a href="http://www.tinyportal.net">Bloc</a></div></div>
   </div>'
;
   
   
// Show the load time?
   
if ($context['show_load_time'])
      echo 
'
   <div id="rendertime">'
$txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</div>';

   
// The following will be used to let the user know that some AJAX process is running
   
echo '
   <div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</div>
</body></html>'
;
}

beginning line 394

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
   global 
$context$settings$options;

   echo 
'
   <div id="linktree">'
;

   
// Each tree item has a URL and name. Some may have extra_before and extra_after.
   
foreach ($context['linktree'] as $link_num => $tree)
   {
      
// Show something before the link?
      
if (isset($tree['extra_before']))
         echo 
$tree['extra_before'];

      
// Show the link, including a URL if it should have one.
      
echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '">' $tree['name'] . '</a>' $tree['name'];

      
// Show something after the link...?
      
if (isset($tree['extra_after']))
         echo 
$tree['extra_after'];

      
// Don't show a separator for the last one.
      
if ($link_num != count($context['linktree']) - 1)
         echo 
'&nbsp;�&nbsp;';
   }

   echo 
'
   </div>'
;
}


beginning line 425

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global 
$context$settings$options$scripturl$txt;

   
// Show the start of the tab section.
   
echo '
   <div id="outer"><div id="container">
      <ul class="dropmenu">'
;

   if(
$context['browser']['is_ie6'])
   {
      foreach (
$context['menu_buttons'] as $act => $button)
      {
         echo 
'
            <li' 
$button['active_button'] ? ' class="chosen"' '' '>
               <a href="'
$button['href'], '"' , isset($button['extra']) ? $button['extra'] : '' '>' $button['title'];
         
         
// any subbuttons then?
         
if(!empty($button['sub_buttons']))
         {
            echo 
'<table cellpadding="0" cellspacing="0"><tr><td>
                  <ul>'
;
            foreach (
$button['sub_buttons'] as $subact => $sbutton)
               echo 
'
                     <li>
                        <a href="'
$sbutton['href'], '">' $sbutton['title'], '</a>
                     </li>'
;
            echo 
'
                  </ul></td></tr></table>'
;
         }
         echo 
'</a>
            </li>'
;
      }
   }
   else
   {
      foreach (
$context['menu_buttons'] as $act => $button)
      {
         echo 
'
            <li' 
$button['active_button'] ? ' class="chosen"' '' '>
               <a href="'
$button['href'], '"' , isset($button['extra']) ? $button['extra'] : '' '>' $button['title'], '</a>';
         
         
// any subbuttons then?
         
if(!empty($button['sub_buttons']))
         {
            echo 
'<ul>';
            foreach (
$button['sub_buttons'] as $subact => $sbutton)
               echo 
'
                     <li>
                        <a href="'
$sbutton['href'], '">' $sbutton['title'], '</a>
                     </li>'
;
            echo 
'
                  </ul>'
;
         }
         echo 
'
            </li>'
;
      }
   }
   echo 
'
      </ul>
   </div></div>'
;
}


beginning line 489

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
   global 
$settings$context$txt$scripturl;

   
// Create the buttons...
   
$buttons = array();
   foreach (
$button_strip as $key => $value)
   {
      if (!isset(
$value['test']) || !empty($context[$value['test']]))
         
$buttons[] = '<a href="' $value['url'] . '" ' . (isset($value['custom']) ? $value['custom'] : '') . '><span>' $txt[$value['text']] . '</span></a>';
   }

   if (empty(
$buttons))
      return 
'';

   
// Make the last one, as easy as possible.
   
$buttons[count($buttons) - 1] = str_replace('<span>''<span class="last">'$buttons[count($buttons) - 1]);

   echo 
'
      <div class="buttonlist'
$direction != 'top' '_bottom' '''">
         <ul class="clearfix">
            <li>'
implode('</li><li>'$buttons), '</li>
         </ul>
      </div>'
;

}


beginning line 516

function tpcode()
{
   global 
$settings$context$options$txt;

   echo 
'
   <div id="innerframe2">      
      <table width="100%" cellspacing="0" cellpadding="2">
         <tr>'
;


// TinyPortal integrated bars
   
if(!empty($settings['use_tp']) && $context['TPortal']['leftbar'])
   {
      echo 
'<td  class="padtop" width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' 'px; padding-top: 4px;padding-right: 1ex; " valign="top">
               <div id="leftbarHeader" style="'
, empty($options['collapse_leftbar']) ? '' 'display: none;''padding-top: 15px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
        
TPortal_sidebar('left');
        echo 
'   </div>
            </td>'
;
   }


   echo 
'
            <td width="100%" align="left" valign="top" style="padding-top: 15px; padding-bottom: 10px;" >'
;
        if(!empty(
$settings['use_tp']) && $context['TPortal']['centerbar'])
                     echo 
'<div>' TPortal_sidebar('center') , '</div>';

}


beginning line 544

function tpcode2()
{
   global 
$settings,$context$txt$options;

   echo 
'
            </td>'
;
   
// TinyPortal integrated bars
   
if(!empty($settings['use_tp']) && $context['TPortal']['rightbar'])
   {
      echo 
'<td  class="padtop" width="' ,$context['TPortal']['rightbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' 'px; padding-top: 4px;padding-right: 1ex;" valign="top">
                 <div id="rightbarHeader" style="'
, empty($options['collapse_rightbar']) ? '' 'display: none;''padding-top: 15px; width: ' ,$context['TPortal']['rightbar_width'], 'px;">';
        
TPortal_sidebar('right');
        echo 
'</div></td>';
   }

   echo 
'   
         </tr>
      </table>
   </div>'
;
}
?>

Yağız...

Find and add after your code:
   <div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
This will show at bottom.

5000 post :O :)

Saver One

Thank you.

Is there  not any way to put the "coupon bar" either on the left side of the page outside the main board area, or at the top under "from the news" ?

Rumbaar

The top put the code in the BoardIndex.template.php file where the news faders is.  As for side positions, I would normally suggest the Ads Management mod.  Though not sure if it's 2.0 compatible.

You can try some portal software and use side bars, but once again limited to ones that are 2.0 compatible.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: