Themes/Language > Theme Support

Edits for ad mod_1-0-7_v1-0-2b on Smf 1.0.7

(1/7) > >>

bigguy:
First edit should be made to the file ModSettings.php in the sources directory:
NOTE: This edit should only be done if totally installing this modification manually

Find:


--- Quote ---* A check box.  Either one or zero. (boolean)
--- End quote ---

and replace with:


--- Quote ---* A textarea. For multilineal textual values.
   ie. array('textarea', 'nameInModSettingsAndSQL', array('OptionalHeightInRows',
         'OptionalWidthInCols'), &$txt['OptionalDescriptionOfTheOption'],
         'OptionalReferenceToHelpAdmin'),

   * A check box.  Either one or zero. (boolean)
--- End quote ---

In the same file find:


--- Quote ---<td class="windowbg2"><label for="' . $config_var[1] . '">' . (isset($config_var[3]) ? $config_var[3] : $txt[$config_id]) . '</label></td>
                     <td class="windowbg2" width="50%">';
--- End quote ---

And replace with:


--- Quote ---                     <![CDATA[<td class="windowbg2" valign="top"><label for="' . $config_var[1] . '">' . (isset($config_var[3]) ? $config_var[3] : $txt[$config_id]) . '</label></td>
                     <td class="windowbg2" valign="top" width="50%">';
--- End quote ---

In same file find:


--- Quote ---// If it's a password...
--- End quote ---

Add before:


--- Quote ---      <![CDATA[// If it's a textarea.
      elseif ($config_type == 'textarea')
         $context['raw_data'] .= '<textarea id="' . $config_id . '" name="' . $config_id . '"' . (isset($config_var[2][0]) ? ' rows="' . $config_var[2][0] . '"' : '') . (isset($config_var[2][1]) ? ' cols="' . $config_var[2][1] . '"' : '') . ' style="font-family: monospace;">' . htmlspecialchars($modSettings[$config_id]) . '</textarea>';
--- End quote ---

In same file find:


--- Quote ---// Text and passwords!
--- End quote ---

Before that add:


--- Quote ---// Textarea.
      elseif ($var[0] == 'textarea')
         $setArray[$var[1]] = $_POST[$var[1]];
--- End quote ---

In same file find:


--- Quote ---   );

   return $config_vars;
--- End quote ---

After that add:


--- Quote ---      array('heading', &$txt['js_ads_title']),
         // Display the ads??
         array('check', 'js_text_displayads_index'),
         array('check', 'js_text_displayads_botindex'),
         array('check', 'js_text_displayads_board_index'),
         array('check', 'js_text_displayads_display'),
         array('check', 'js_text_displayads_message_index'),
         array('check', 'js_text_displayads_firstpost'),
         array('textarea', 'js_text_content',array('10','50'), &$txt['js_text_disc'],'js_text_help'),
      ]]
--- End quote ---

These are edits for 1 file in  ad_mod_1-0-7_v1-0-2b for smf 1.0.7

bigguy:
NEXT EDIT: In the langauge directory of the theme you are trying to modify find and open "Modifications.english.php"

Find:


--- Quote ---?>
--- End quote ---

After that add:


--- Quote ---// Js - Strings

$txt['js_ads_title'] = 'Ad Management';
$txt['js_text_displayads_index'] = 'Display ads on every page (ontop)';
$txt['js_text_displayads_botindex'] = 'Display ads on every page (onbottom)';
$txt['js_text_displayads_board_index'] = 'Display ads on Board Index';
$txt['js_text_displayads_display'] = 'Display ads on Thread';
$txt['js_text_displayads_message_index'] = 'Display ads on Thread Index';
$txt['js_text_displayads_firstpost'] = 'Display ads after first post';
$txt['js_text_disc'] = 'Write your code here';
$txt['js_text_help'] = 'Make sure that your code is compatible with HTML';
$txt['permissiongroup_ad_manage'] = 'Ad Management';
$txt['permissionname_ad_manageperm'] = 'Enable ads';
$txt['permissionhelp_ad_manageperm'] = 'To enable ads to appear for this membergroup, this must be checked';
--- End quote ---

Close, save and upload. (Only if you have a backup of the original file you are modifying)

bigguy:
NEXT EDIT: In your themes directory of the theme you want to modify find the "Index.template.php" file open it.

Find this:


--- Quote ---<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
--- End quote ---

And replace with this:


--- Quote ---<table width="100%" cellpadding="0" cellspacing="0" border="0">';
if ($modSettings['js_text_displayads_index'] && allowedTo('ad_manageperm'))
{
   echo '   <tr><td id="bodyarea">
         <br />
            <div align="center">',$modSettings['js_text_content'],'</div></td></tr>';
}
echo '<tr>
--- End quote ---

In same file find:


--- Quote ---   echo '
--- End quote ---

and replace with:


--- Quote ---   global $modSettings;
   echo '</td></tr>';
if ($modSettings['js_text_displayads_botindex'] && allowedTo('ad_manageperm'))
{
   echo '   <tr><td id="bodyarea">
            <div align="center">',$modSettings['js_text_content'],'</div><br /></td></tr>';
}

   echo '</table>';
--- End quote ---

Save, close and upload....after backing up the original "Index.template.php"

bigguy:
NEXT EDIT: In the theme directory of the theme you are trying to modify find the "BoardIndex.template.php" file open it and

Find this:


--- Quote ---    echo '
<table width="100%" cellpadding="3" cellspacing="0">
--- End quote ---

And replace with this:


--- Quote ---if ($modSettings['js_text_displayads_board_index'] && allowedTo('ad_manageperm'))
   echo '<div align="center">',$modSettings['js_text_content'],'</div>';
echo '
<table width="100%" cellpadding="3" cellspacing="0">
--- End quote ---

Save, close and upload...Only after making a backup.

bigguy:
NEXT EDIT: In the theme directory of the theme you are trying to modify find "Display.template.php" open it and

Find:


--- Quote ---   // Show the linktree as well as the "Who's Viewing" information.
--- End quote ---

And replace with:


--- Quote ---if ($modSettings['js_text_displayads_display'] && allowedTo('ad_manageperm'))
   echo '<div align="center">',$modSettings['js_text_content'],'</div>';

   // Show the linktree as well as the "Who's Viewing" information.

--- End quote ---

In the same file find:


--- Quote ---   </td></tr>';
   }
--- End quote ---

And replace with:


--- Quote ---   </td></tr>';
if ($message['id'] == $context['first_message'] && allowedTo('ad_manageperm'))
   if ($modSettings['js_text_displayads_firstpost'])
   {
      echo '

   <tr><td style="padding: 1px 1px 0 1px;">
      <table width="100%" cellpadding="3" cellspacing="0" border="0">
         <tr><td class="windowbg2">
            <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
               <tr>
                  <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
                     <b>', $context['forum_name'], '</b>
                     <div class="smalltext">
                     </div>
                  </td>
                  <td valign="top" width="85%" height="100%">
                     <table width="100%" border="0"><tr>
                        <td valign="middle"><img src="', $settings['images_url'], '/post/' . $message['icon'] . '.gif" alt="" border="0" /></td>
                        <td valign="middle">
                           <div style="font-weight: bold;" id="subject_', $message['id'], '">
                              <a href="', $message['href'], '">', $message['subject'], '</a>
                           </div>
                           <div class="smalltext">? <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' ?</div></td>
                        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';

      // Can they reply?  Have they turned on quick reply?
      if ($context['can_reply'] && !empty($options['display_quick_reply']))
         echo '
            ', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]) ,'';
      // So... quick reply is off, but they *can* reply?
      elseif ($context['can_reply'])
         echo '
            ', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]) ,'';

      // Can the user modify the contents of this post?
      if ($message['can_modify'])
         echo '
            ', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/modify.gif" alt="' . $txt[66] . '" border="0" />' : $txt[17]) ,'';

      // How about... even... remove it entirely?!
      if ($message['can_remove'])
         echo '
            ', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete.gif" alt="' . $txt[121] . '" border="0" />' : $txt[31]) ,'';

      // What about splitting it off the rest of the topic?
      if ($context['can_split'])
         echo '
            ', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/split.gif" alt="' . $txt['smf251'] . '" border="0" />' : $txt['smf251']) ,'';

echo '
                        </td>
                     </tr></table>
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="post">', $modSettings['js_text_content'] , '</div>
                  </td>
               </tr>
               <tr>
                  <td valign="bottom" class="smalltext" width="85%">
                     <table width="100%" border="0" style="table-layout: fixed;"><tr>
                        <td colspan="2" class="smalltext" width="100%">
                     </tr><tr>
                        <td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
                        </td>
                        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
                           <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
                        </td>
                     </tr></table>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
   }

   }
--- End quote ---

Save, close and upload....Only after making a backup

Navigation

[0] Message Index

[#] Next page

Go to full version