News:

Help keep this project going by donating or buying adseller pro

Main Menu
Coinbase

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

Started by bigguy, July 04, 2006, 10:55:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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)

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)

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%">';

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%">';

In same file find:

Quote// If it's a password...

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>';

In same file find:

Quote// Text and passwords!

Before that add:

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

In same file find:

Quote);

   return $config_vars;

After that add:

Quotearray('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'),
      ]]

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?>

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';

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>

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>

In same file find:

Quoteecho '

and replace with:

Quoteglobal $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>';

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:

Quoteecho '
<table width="100%" cellpadding="3" cellspacing="0">

And replace with this:

Quoteif ($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">

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.

And replace with:

Quoteif ($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.

In the same file find:

Quote</td></tr>';
   }

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>';
   }

   }

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 the MessageIndex.template.php open it and

Find:

Quoteecho '
      <table width="100%" cellpadding="3" cellspacing="0">

And replace with:

Quoteif ($modSettings['js_text_displayads_message_index'] && allowedTo('ad_manageperm'))
   echo '<div align="center">',$modSettings['js_text_content'],'</div>';

   echo '
      <table width="100%" cellpadding="3" cellspacing="0">

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

bigguy

NEXT EDIT: In the Sources Directory of your forum find the "ManagePermissions.php" open it and

Find:

Quote'pm' => array(

And replace with:

Quote'ad_manage' => array(
            'ad_manageperm' => false,
         ),
         'pm' => array(
NOTE: This edit should only be done if totally install the mod manually.

hygron

I found them...

Hey bigguy, sorry, but I was linked to 1.1 edits from TP and I posted asking for direction's here.

I have a question?  I notice that some edits are to be used only if installing the entire mod manually...Well,

I have smf1.0.7 with tiny portal, and techhead theme.  I attempted to install ad manager mod thru package manager and all files installed successfully except
index.template.php
 
I got failure on that file alone...so, can I just use the index.template.php edits you have here and be done with it, or do I have to edit other files?

thanks, hygron
Live a greener healthier intentionally self-substantial lifestyle, and leave a smaller footprint on dear "Mother Earth"

bigguy

Yes just use the edits for the Index.template.php file and you`ll be good to go.

hygron

OK, bigguy...I did the 1st edit, but the 2nd edit
   echo'

well "echo'" is 4-5 location's!  I figured safer to ask you which echo' to edit, or do you replace all?  Thanks H
Live a greener healthier intentionally self-substantial lifestyle, and leave a smaller footprint on dear "Mother Earth"

hygron

Ok...I did the edit and received this message...
Parse error: parse error, unexpected '<' in /home/hygron/domains/hygronomics.com/public_html/forums/Themes/techead/index.template.php on line 401

so, go find  '<' and delete?  I assume line 401 means 401lines from top of page???

Live a greener healthier intentionally self-substantial lifestyle, and leave a smaller footprint on dear "Mother Earth"

bigguy

#11
You want to look for the first "echo" after the code you just installed:

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>

What type of editor are you using ??? I suggest using "Php Designer 2006" You can find it on google.

hygron

I found the info on which echo'?  1st echo after... downthread from here and edited...

Now I get this message:

Parse error: parse error, unexpected '<' in /home/hygron/domains/hygronomics.com/public_html/forums/Themes/techead/index.template.php on line 408

I am editing in my direct admin file manager.  forums/themes/techead/index.template.php.

Live a greener healthier intentionally self-substantial lifestyle, and leave a smaller footprint on dear "Mother Earth"

hygron

#13
Ok...I cut out edits I made...forums back online ;D

then I went and was real careful...made a nice folder in notepad and triple checked the code...  I read the other thread below, and re-edit the  themes/index.template.php/techead file on server...

Now I got this error message:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/hygron/domains/hygronomics.com/public_html/forums/Themes/techead/index.template.php on line 366

thanks


what do you think?   I am leaving it alone...but, I have figured out how to put it
back. 8)  thanks, H
Live a greener healthier intentionally self-substantial lifestyle, and leave a smaller footprint on dear "Mother Earth"

bigguy

If you have a copy of the file without edits in it post it here and I'll see if I have any luck with it.