Welcome, Guest. Please Login or Register.
May 08, 2025, 08:58:10 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  I need some help writing this. It isn't reading or writing it. « previous next »
Pages: [1] Reply Ignore Print
Author Topic: I need some help writing this. It isn't reading or writing it.  (Read 253 times)
WedgeAntilles250
Guest
I need some help writing this. It isn't reading or writing it.
« on: December 03, 2002, 11:53:43 PM »
Reply with quote

<edit file>
Sources/ModSettings.php
</edit file>

<search for>
       $enableHitStatsChecked = ($modSettings['hitStats'] == '1')?' checked':'';
</search for>

<add after>
       $enableUserSideActivationChecked = ($modSettings['UserSideActivation'] == '1')?' checked':'';
</add after>

<search for>
   $onoffArray = array('stickyTopicsChecked'=>'enableStickyTopics', 'titlesEnableChecked'=>'titlesEnable', 'topbottomEnableChecked'=>'topbottomEnable', 'onlineEnableChecked'=>'onlineEnable', 'todayModChecked'=>'todayMod', 'previousNextModChecked'=>'enablePreviousNext', 'enableVBStyleLoginChecked'=>'enableVBStyleLogin', 'enableCompressedOutputChecked'=>'enableCompressedOutput', 'karmaTRAChecked'=>'karmaTimeRestrictAdmins', 'disableCachingChecked'=>'disableCaching', 'enableInlineLinksChecked'=>'enableInlineLinks', 'attachCheckExten'=>'attachmentCheckExtensions', 'attachGuest'=>'attachmentEnableGuest', 'attachShow'=>'attachmentShowImages', 'enableSP1Info'=>'enableSP1Info', 'enableUserTopicLockingChecked'=>'enableUserTopicLocking', 'enableReportToModChecked'=>'enableReportToMod', 'enableErrorLoggingChecked'=>'enableErrorLogging', 'viewNewestFirstChecked'=>'viewNewestFirst',  'userLanguageChecked'=>'userLanguage', 'trackStatsChecked'=>'trackStats', 'hitStatsChecked'=>'hitStats', 'notifyAnncmnts_UserDisable'=>'notifyAnncmnts_UserDisable', 'censorWholeWordChecked'=>'censorWholeWord', 'compactTopicPagesChecked'=>'compactTopicPagesEnable');
</search for>

<replace>
   $onoffArray = array('stickyTopicsChecked'=>'enableStickyTopics', 'titlesEnableChecked'=>'titlesEnable', 'topbottomEnableChecked'=>'topbottomEnable', 'onlineEnableChecked'=>'onlineEnable', 'todayModChecked'=>'todayMod', 'previousNextModChecked'=>'enablePreviousNext', 'enableVBStyleLoginChecked'=>'enableVBStyleLogin', 'enableCompressedOutputChecked'=>'enableCompressedOutput', 'karmaTRAChecked'=>'karmaTimeRestrictAdmins', 'disableCachingChecked'=>'disableCaching', 'enableInlineLinksChecked'=>'enableInlineLinks', 'attachCheckExten'=>'attachmentCheckExtensions', 'attachGuest'=>'attachmentEnableGuest', 'attachShow'=>'attachmentShowImages', 'enableSP1Info'=>'enableSP1Info', 'enableUserTopicLockingChecked'=>'enableUserTopicLocking', 'enableReportToModChecked'=>'enableReportToMod', 'enableErrorLoggingChecked'=>'enableErrorLogging', 'viewNewestFirstChecked'=>'viewNewestFirst',  'userLanguageChecked'=>'userLanguage', 'trackStatsChecked'=>'trackStats', 'hitStatsChecked'=>'hitStats', 'notifyAnncmnts_UserDisable'=>'notifyAnncmnts_UserDisable', 'censorWholeWordChecked'=>'censorWholeWord', 'compactTopicPagesChecked'=>'compactTopicPagesEnable', 'UserSideActivationChecked'=>'UserSideActivation');
</replace>

<search for>
  </tr><tr>
    <td class="windowbg2" bgcolor="$color[windowbg2]" colspan=2><HR size="1" width="100%" class="windowbg3"></td>
  </tr><tr>
    <td class="windowbg2" bgcolor="$color[windowbg2]"><font size="2">$txt[yse_maxwidth]</font></td>
    <td class="windowbg2" bgcolor="$color[windowbg2]"><input type=text name="maxwidth" value="$modSettings[maxwidth]"></td>
</search for>

<add after>
  </tr><tr>
    <td class="windowbg2" bgcolor="$color[windowbg2]" colspan=2><HR size="1" width="100%" class="windowbg3"></td>
  </tr><tr>
    <td class="windowbg2" bgcolor="$color[windowbg2]"><font size="2">$txt[UserSideActivate7]</font></td>
    <td class="windowbg2" bgcolor="$color[windowbg2]"><input type=checkbox name="UserSideActivationChecked" $enableUserSideActivationChecked></td>
</add after>

Here is the code, but for some reason, it isn't working at all.  The ModSetting is not being written to the Settings in the database.

What am I doing wrong?
Logged
Jack.R.Abbit
Mod Team
YaBB God
*****
Posts: 553


RACE FOR SPENT!

Re:I need some help writing this. It isn't reading or writing it.
« Reply #1 on: December 05, 2002, 01:09:35 AM »
Reply with quote

Since the ModSettings.php simply does an UPDATE to the table, you must actually insert the entry into the table before it can read and write it through the "Mod Settings" Page.  This would be done using a .php file that performs a database INSERT for that.

-Jack
Logged

<--------  Mods by Jack  -------->
Package Server: http://www.modsbydesign.com/mods.by.jack/yabbse/ (now serving)


|----------------------------------------------|
|                                              |
|          DON'T PM ME FOR SUPPORT!             |
|                                              |
|----------------------------------------------|
WedgeAntilles250
Guest
Re:I need some help writing this. It isn't reading or writing it.
« Reply #2 on: December 05, 2002, 04:29:28 AM »
Reply with quote

Oh, I thought that since it saves it, it would create the field also.
Logged
Jack.R.Abbit
Mod Team
YaBB God
*****
Posts: 553


RACE FOR SPENT!

Re:I need some help writing this. It isn't reading or writing it.
« Reply #3 on: December 05, 2002, 05:21:02 AM »
Reply with quote

I thought so too, the first time I tried to do it... then I saw the UPDATE and never an INSERT to be found...

-Jack
Logged

<--------  Mods by Jack  -------->
Package Server: http://www.modsbydesign.com/mods.by.jack/yabbse/ (now serving)


|----------------------------------------------|
|                                              |
|          DON'T PM ME FOR SUPPORT!             |
|                                              |
|----------------------------------------------|
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  I need some help writing this. It isn't reading or writing it. « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.149 seconds with 21 queries.