SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

Manu.G

Maybe I can answer for scubaru, cause I have the same problem.
If you want you can take a look at our arcade block.
URL: http://forum.arseniums.com (Our arcade block is named "Games"  8) )

There aren't any error logs.

Another problem was coming up after I activated the Gallery block.
The portal was loading and loading, I couldn't enter the portal. Some minutes
later I could enter the portal and I could see an error message in the Gallery
block. I forgot to copy the error message, cause I went back to the portal settings
and switched off the Gallery block. Later this day I will activate the Gallery block
again to see what will happen than.  :-\
Version SMF 2.0.8
SimplePortal 2.3.5

scubaru

Quote from: Manu0372 on April 26, 2008, 12:13:06 PM
Maybe I can answer for scubaru, cause I have the same problem.
If you want you can take a look at our arcade block.
URL: http://forum.arseniums.com (Our arcade block is named "Games"  8) )

There aren't any error logs.

Another problem was coming up after I activated the Gallery block.
The portal was loading and loading, I couldn't enter the portal. Some minutes
later I could enter the portal and I could see an error message in the Gallery
block. I forgot to copy the error message, cause I went back to the portal settings
and switched off the Gallery block. Later this day I will activate the Gallery block
again to see what will happen than.  :-\

I Would like to add that yes I have the number of people to display in the block set at 5.  Tried 10 with no difference.
Also there re no errors present in the log.

Manu0372 I noticed on your site that you get multiple people listed in the block but all have the number 1 listed in front of them.  I on the other hand am only seeing 1 person listed.
check out for your self if you like

URL: http://www.scubaru.selfip.com

thanks again

Scubaru

Manu.G

Quote from: scubaru on April 26, 2008, 12:35:52 PM
Quote from: Manu0372 on April 26, 2008, 12:13:06 PM
Maybe I can answer for scubaru, cause I have the same problem.
If you want you can take a look at our arcade block.
URL: http://forum.arseniums.com (Our arcade block is named "Games"  8) )

There aren't any error logs.

Another problem was coming up after I activated the Gallery block.
The portal was loading and loading, I couldn't enter the portal. Some minutes
later I could enter the portal and I could see an error message in the Gallery
block. I forgot to copy the error message, cause I went back to the portal settings
and switched off the Gallery block. Later this day I will activate the Gallery block
again to see what will happen than.  :-\

I Would like to add that yes I have the number of people to display in the block set at 5.  Tried 10 with no difference.
Also there re no errors present in the log.

Manu0372 I noticed on your site that you get multiple people listed in the block but all have the number 1 listed in front of them.  I on the other hand am only seeing 1 person listed.
check out for your self if you like

URL: http://www.scubaru.selfip.com

thanks again

Before I changed the code the numbers was counting correct, but I got a lot of
error messages in the log. The errors are gone, but the counting isn't correct,
but with that I can handle perfect.

How many high scores are in your arcade? How many members in your forum
have played a game? Maybe you was the only one till now who has played a game?  :)
Version SMF 2.0.8
SimplePortal 2.3.5

scubaru

Quote from: Manu0372 on April 26, 2008, 12:45:24 PM
Quote from: scubaru on April 26, 2008, 12:35:52 PM
Quote from: Manu0372 on April 26, 2008, 12:13:06 PM
Maybe I can answer for scubaru, cause I have the same problem.
If you want you can take a look at our arcade block.
URL: http://forum.arseniums.com (Our arcade block is named "Games"  8) )

There aren't any error logs.

Another problem was coming up after I activated the Gallery block.
The portal was loading and loading, I couldn't enter the portal. Some minutes
later I could enter the portal and I could see an error message in the Gallery
block. I forgot to copy the error message, cause I went back to the portal settings
and switched off the Gallery block. Later this day I will activate the Gallery block
again to see what will happen than.  :-\

I Would like to add that yes I have the number of people to display in the block set at 5.  Tried 10 with no difference.
Also there re no errors present in the log.

Manu0372 I noticed on your site that you get multiple people listed in the block but all have the number 1 listed in front of them.  I on the other hand am only seeing 1 person listed.
check out for your self if you like

URL: http://www.scubaru.selfip.com

thanks again

Before I changed the code the numbers was counting correct, but I got a lot of
error messages in the log. The errors are gone, but the counting isn't correct,
but with that I can handle perfect.

How many high scores are in your arcade? How many members in your forum
have played a game? Maybe you was the only one till now who has played a game?  :)

that was why I provided the link ;)
3 players so far and about 50+ games with high scores in them
the forum itself is quite new and only has 7 members
I have the most wins on the board.  The person displayed on the Arcade Block actually has the fewest wins of the 3 players currently

Scubaru

scubaru

OK it's official, I am a twit...

Figured out it was my fault.

I added the line of code After the find code not before it. ???

Works perfectly now as it should have with such great advice sorry for the troubles.

Humbly Yours, Scubaru


Scubaru

Manu.G

Quote from: scubaru on April 26, 2008, 01:09:00 PM
OK it's official, I am a twit...

Figured out it was my fault.

I added the line of code After the find code not before it. ???

Works perfectly now as it should have with such great advice sorry for the troubles.

Humbly Yours, Scubaru

=)) The same was with my code =))
Thanks for the hint. :D
Version SMF 2.0.8
SimplePortal 2.3.5

scubaru

Glad my mistake could help someone else. :D

So all is well with the Arcade block now!!!

Thanks again.
Scubaru
Scubaru

[SiNaN]

I love users who find the problem themselves. :D
Former SMF Core Developer | My Mods | SimplePortal

Sudhakar Arjunan

Hi SiNaN,

Thank you for your Excellent and Simple Mod.

I got two errors while installing, Source/modsettings and themedir/index template.

I have Manually installed.

Great , its showing up @ http://forum.itacumens.com

But when i tried to change the announcement and tick some option and save it thru admin panel .

But i do find its not saving everytime and automatically redirects to basic feature link.

Could you point out what was the exact error would be Mr.SiNaN

Thanks in Advance,
Sudhakar, Admin
www.itacumens.com
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

[SiNaN]

Can you attach your ../Sources/ModSettings.php file?
Former SMF Core Developer | My Mods | SimplePortal

Sudhakar Arjunan

Thanks for your instant Responce,
pls check the code ../Sources/Modsettings.php

<?php
/**********************************************************************************
* ModSettings.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* This file is here to make it easier for installed mods to have settings
and options.  It uses the following functions:

void ModifyFeatureSettings()
// !!!

void ModifyFeatureSettings2()
// !!!

void ModifyBasicSettings()
// !!!

void ModifyLayoutSettings()
// !!!

void ModifyKarmaSettings()
// !!!

Adding new settings to the $modSettings array:
---------------------------------------------------------------------------
// !!!
*/

/* Adding options to one of the setting screens isn't hard.  The basic format for a checkbox is:
array('check', 'nameInModSettingsAndSQL'),

   And for a text box:
array('text', 'nameInModSettingsAndSQL')
   (NOTE: You have to add an entry for this at the bottom!)

   In these cases, it will look for $txt['nameInModSettingsAndSQL'] as the description,
   and $helptxt['nameInModSettingsAndSQL'] as the help popup description.

Here's a quick explanation of how to add a new item:

 * A text input box.  For textual values.
ie. array('text', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A text input box.  For numerical values.
ie. array('int', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A text input box.  For floating point values.
ie. array('float', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

         * A large text input box. Used for textual values spanning multiple lines.
ie. array('large_text', 'nameInModSettingsAndSQL', 'OptionalNumberOfRows',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A check box.  Either one or zero. (boolean)
ie. array('check', 'nameInModSettingsAndSQL', null, &$txt['descriptionOfTheOption'],
'OptionalReferenceToHelpAdmin'),

 * A selection box.  Used for the selection of something from a list.
ie. array('select', 'nameInModSettingsAndSQL', array('valueForSQL' => &$txt['displayedValue']),
&$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),
Note that just saying array('first', 'second') will put 0 in the SQL for 'first'.

 * A password input box. Used for passwords, no less!
ie. array('password', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

For each option:
type (see above), variable name, size/possible values, description, helptext.
OR make type 'rule' for an empty string for a horizontal rule.
OR make type 'heading' with a string for a titled section. */

// This function passes control through to the relevant tab.
function ModifyFeatureSettings()
{
global $context$txt$scripturl$modSettings$sourcedir;

// You need to be an admin to edit settings!
isAllowedTo('admin_forum');

// All the admin bar, to make it right.
adminIndex('edit_mods_settings');
loadLanguage('Help');
loadLanguage('HidePost');
loadLanguage('ModSettings');

// Will need the utility functions from here.
require_once($sourcedir '/ManageServer.php');

$context['page_title'] = $txt['modSettings_title'];
$context['sub_template'] = 'show_settings';

$subActions = array(
'rog' => 'rantonguestsSettings',
'invite' => 'ModifyInviteSettings',
'custombbc' => 'ModifyCustomBBCodeSettings',

'aeiou' => 'ModifyAeiouSettings', 'actions' => 'ModifyActionSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
                
'sportal' => 'ModifySPortalSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'karma' => 'ModifyKarmaSettings',
// --- Begin modification - SMFBlog ---
'usercp' => 'ModifyUserCPSettings',
// --- End modification ---

'profile' => 'ModifyProfileSettings',
'chatroomButton' => 'ModifyChatroomButtonSettings',

'websiteButton' => 'ModifyWebsiteButtonSettings',

);

// By default do the basic settings.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
$context['sub_action'] = $_REQUEST['sa'];

loadLanguage('CustomProfile');
// Load up all the tabs...
$context['admin_tabs'] = array(
'title' => &$txt['modSettings_title'],
'help' => 'modsettings',
'description' => $txt['smf3'],
'tabs' => array(
'basic' => array(
'title' => $txt['mods_cat_features'],
'href' => $scripturl '?action=featuresettings;sa=basic;sesc=' $context['session_id'],
),
'actions' => array(
'title' => 'Custom Actions',
'href' => $scripturl '?action=featuresettings;sa=actions;sesc=' $context['session_id'],
),
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl '?action=featuresettings;sa=layout;sesc=' $context['session_id'],
),
'sportal' => array(
'title' => $txt['mods_cat_sportal'],
'href' => $scripturl '?action=featuresettings;sa=sportal;sesc=' $context['session_id'],
),
'rog' => array(
'title' => $txt['rog_settings'],
'href' => $scripturl '?action=featuresettings;sa=rog;sesc=' $context['session_id'],
),

'invite' => array(
'title' => $txt['invite_title'],
'href' => $scripturl '?action=featuresettings;sa=invite;sesc=' $context['session_id'],
),
'MemberColorLinks' => array(
'title' => $txt['MemberColorLinkHeadline'],
'href' => $scripturl '?action=featuresettings;sa=MemberColorLinks;sesc=' $context['session_id'],
),

'custombbc' => array(
'title' => $txt['customBBCode_tabtitle'],
'href' => $scripturl '?action=featuresettings;sa=custombbc;sesc=' $context['session_id'],
),
'profile' => array(
'title' => $txt['cp_cpfields'],
'href' => $scripturl '?action=featuresettings;sa=profile;sesc=' $context['session_id'],
),
// --- Begin modification - UserCP ---
'usercp' => array(
'title' => $txt['usercp'],
'href' => $scripturl '?action=featuresettings;sa=usercp;sesc=' $context['session_id'],
),
// --- End modification ---

                        
'chatroomButton' => array(
                                
'title' => $txt['chatroomButton_title'],
                                
'href' => $scripturl '?action=featuresettings;sa=chatroomButton;sesc=' $context['session_id'],
),
                        
'websiteButton' => array(
                                
'title' => $txt['websiteButton_title'],
                                
'href' => $scripturl '?action=featuresettings;sa=websiteButton;sesc=' $context['session_id'],                        
),
'karma' => array(
'title' => $txt['smf293'],
'href' => $scripturl '?action=featuresettings;sa=karma;sesc=' $context['session_id'],
),
'aeiou' => array(
'title' => $txt['aeiou'],
'href' => $scripturl '?action=featuresettings;sa=aeiou;sesc=' $context['session_id'],
'is_last' => true,
),
),
);

// Select the right tab based on the sub action.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']]))
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;

// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}

// This function basically just redirects to the right save function.
function ModifyFeatureSettings2()
{
global $context$txt$scripturl$modSettings$sourcedir;

isAllowedTo('admin_forum');
loadLanguage('ModSettings');

// Quick session check...
checkSession();

require_once($sourcedir '/ManageServer.php');

$subActions = array(
'rog' => 'rantonguestsSettings',
'invite' => 'ModifyInviteSettings',
'custombbc' => 'ModifyCustomBBCodeSettings',

'aeiou' => 'ModifyAeiouSettings', 'actions' => 'ModifyActionSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'karma' => 'ModifyKarmaSettings',
// --- Begin modification - UserCP ---
'usercp' => 'ModifyUserCPSettings',
// --- End modification ---

'profile' => 'ModifyProfileSettings',
'chatroomButton' => 'ModifyChatroomButtonSettings',

'websiteButton' => 'ModifyWebsiteButtonSettings',

);

// Default to core (I assume)
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';

// Actually call the saving function.
$subActions[$_REQUEST['sa']]();
}

function 
ModifyBasicSettings()
{
global $txt$scripturl$context$settings$sc$modSettings;

$config_vars = array(
// Big Options... polls, sticky, bbc....
array('select''pollMode', array(&$txt['smf34'], &$txt['smf32'], &$txt['smf33'])),
'',
// Basic stuff, user languages, titles, flash, permissions...
array('check''allow_guestAccess'),
array('check''userLanguage'),
array('check''allow_editDisplayName'),
array('check''allow_hideOnline'),
array('check''allow_hideEmail'),
array('check''guest_hideContacts'),
array('check''titlesEnable'),
array('check''enable_buddylist'),
array('text''color_buddylist'),
array('text''default_personalText'),
array('int''max_signatureLength'),
array('int''award_max_width'),
array('int''award_max_height'),
'',
// MCLegendII
array('text''arrange_mclegend'),
'',
// MCLegendII
array('text''arrange_mclegend'),
'',
// Stats, compression, cookies.... server type stuff.
array('text''time_format'),
array('select''number_format', array('1234.00' => '1234.00''1,234.00' => '1,234.00''1.234,00' => '1.234,00''1 234,00' => '1 234,00''1234,00' => '1234,00')),
array('float''time_offset'),
array('int''failed_login_threshold'),
array('int''lastActive'),
array('check''trackStats'),
array('check''hitStats'),
array('check''enableErrorLogging'),
array('check''securityDisable'),
'',
// Related Topics
array('check''relatedTopicsEnabled'),
array('int''relatedTopicsCount'),
array('select''relatedMethod', array('fulltext' => &$txt['relatedFulltext'], 'custom' => &$txt['relatedCustom'])),

'',
// Reactive on email, and approve on delete
array('check''send_validation_onChange'),
array('check''approveAccountDeletion'),
'',
// Option-ish things... miscellaneous sorta.
array('check''allow_disableAnnounce'),
array('check''disallow_sendBody'),
array('check''modlog_enabled'),
array('check''queryless_urls'),
'',
array('check''sitemap_xml'),
array('int''sitemap_topic_count'),
array('check''sitemap_collapsible'),
'',
// Width/Height image reduction.
array('int''max_image_width'),
array('int''max_image_height'),
'',
// Show NNTP Syndicate Options
array('check''nntp_syndicate_enable'),
array('text''nntp_syndicate_server'),
array('text''nntp_syndicate_port'),
array('check''nntp_syndicate_authentication'),
array('text''nntp_syndicate_username'),
array('text''nntp_syndicate_password'),

'',
// No Reply Email??
array('check''enableNoReply'),
array('text''NoReplyEmail'),
array('text''NoReplyMessage'),
'',
// Hide post or not? ;).
array('check''allow_hiddenPost'),
array('check''show_hiddenMessage'),
array('int''max_hiddenValue'),
array('text''show_hiddenColor'),
'',
// Reporting of personal messages?
array('check''enableSinglePM'),

array('check''enableReportPM'),
array('check''SaveAllPMsEnabled'),
);

// Saving?
if (isset($_GET['save']))
{
// Fix PM settings.
$_POST['pm_spam_settings'] = (int) $_POST['max_pm_recipients'] . ',' . (int) $_POST['pm_posts_verification'] . ',' . (int) $_POST['pm_posts_per_hour'];
$save_vars $config_vars;
$save_vars[] = array('text''pm_spam_settings');

saveDBSettings($save_vars);

writeLog();
redirectexit('action=featuresettings;sa=basic');
}

// Hack for PM spam settings.
list ($modSettings['max_pm_recipients'], $modSettings['pm_posts_verification'], $modSettings['pm_posts_per_hour']) = explode(','$modSettings['pm_spam_settings']);
$config_vars[] = array('int''max_pm_recipients');
$config_vars[] = array('int''pm_posts_verification');
$config_vars[] = array('int''pm_posts_per_hour');

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=basic';
$context['settings_title'] = $txt['mods_cat_features'];

prepareDBSettingContext($config_vars);
}

function 
ModifyLayoutSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
// Compact pages?
array('check''compactTopicPagesEnable'),
array('int''compactTopicPagesContiguous'null$txt['smf235'] . '<div class="smalltext">' str_replace(' ''&nbsp;''"3" ' $txt['smf236'] . ': <b>1 ... 4 [5] 6 ... 9</b>') . '<br />' str_replace(' ''&nbsp;''"5" ' $txt['smf236'] . ': <b>1 ... 3 4 [5] 6 7 ... 9</b>') . '</div>'),
'',
// Stuff that just is everywhere - today, search, online, etc.
array('select''todayMod', array(&$txt['smf290'], &$txt['smf291'], &$txt['smf292'])),
array('check''topbottomEnable'),
array('check''onlineEnable'),
array('check''enableVBStyleLogin'),
'',
// Pagination stuff.
array('int''defaultMaxMembers'),
'',
// This is like debugging sorta.
array('check''timeLoadPageEnable'),
array('check''disableHostnameLookup'),
'',
// Who's online.
array('check''who_enabled'),
'',
// Board Viewers By HarzeM
array('check''enable_board_viewers'),
array('check''boardViewersGuestsMembers'),
array('check''boardViewersClickable'),
array('check''countChildPosts'), '',
      
// Recent topics ?
      
array('check''recent_topics',null, &$txt['recent_topics']),

);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=layout');

loadUserSettings();
writeLog();
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=layout';
$context['settings_title'] = $txt['mods_cat_layout'];

prepareDBSettingContext($config_vars);
}
function 
ModifySPortalSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
// What does it look like?  [smite]?
array('check''lshowdetails'),
array('check''aspecificannounce'),
array('check''nshowavatar'),
array('select''tttype', array(&$txt[110], &$txt[301])),
array('select''gallerytype', array(&$txt['galleryrandom'], &$txt['gallerylatest'])),
'',
array('text''aannouncetext'),
array('int''nnewsboard'),
array('int''nnewscount'),
array('int''nnewslength'),
array('int''rppostcount'),
array('int''rttopiccount'),
array('int''ppollid'),
array('int''tppcount'),
array('int''tbbcount'),
array('int''tttcount'),
array('int''arcadebpcount'),
'',
array('check''showleft'),
array('check''showright'),
array('int''leftwidth'),
array('int''rightwidth'),
'',
array('check''showuser'),
array('check''showusersonline'),
array('check''showboardstats'),
array('check''showlatestmember'),
array('check''showquicksearch'),
array('check''showannouncements'),
array('check''showboardnews'),
array('check''showrecentposts'),
array('check''showrecenttopics'),
array('check''showtoppoll'),
array('check''showtopposters'),
array('check''showtopboards'),
array('check''showtoptopics'),
array('check''showrecentpurchase'),
array('check''showgallery'),
array('check''showarcade'),
'',
array('check''advertiselefton'),
array('select''advertiselefttype', array(&$txt['advertisehtml'], &$txt['advertisephp'])),
array('large_text''advertiseleft'),
array('check''advertiserighton'),
array('select''advertiserighttype', array(&$txt['advertisehtml'], &$txt['advertisephp'])),
array('large_text''advertiseright'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=sportal');
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=sportal';
$context['settings_title'] = $txt['sportalsettings'];

prepareDBSettingContext($config_vars);
}
function 
ModifyProfileSettings()
{
global $sourcedir;
require_once($sourcedir '/CustomProfile.php');
CustomFieldSettings();
}

function 
ModifyChatroomButtonSettings()
{
global $txt$scripturl$context$settings$sc;

// WebsiteButton 1.0 Settings
$config_vars = array(
array('select''chatroomButton_ga', array(
=> &$txt['chatroom_disabled'],
=> &$txt['chatroom_enabled'],
)),
array('text''chatroomButton_url'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=chatroomButton');
}

        
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=chatroomButton';
        
$context['settings_title'] = isset($txt['chatroomButton_title']) ? $txt['chatroomButton_title'] : 'Chatroom';

prepareDBSettingContext($config_vars);
}
function 
ModifyWebsiteButtonSettings()
{
global $txt$scripturl$context$settings$sc;

// WebsiteButton 1.0 Settings
$config_vars = array(
array('text''websiteButton_url'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=websiteButton');
}

        
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=websiteButton';
        
$context['settings_title'] = isset($txt['websiteButton_title']) ? $txt['websiteButton_title'] : 'Website';

prepareDBSettingContext($config_vars);
}
// Invite MOD
function ModifyInviteSettings()
{
global $sourcedir;
require_once($sourcedir '/Invite.php');
InviteSettings();
}


function 
rantonguestsSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
//Rant on Guests mod rog mod
array('text''rog_title'),
array('text''rog_post'),

);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=rog');
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=rog';
$context['settings_title'] = $txt['rog_settings'];

prepareDBSettingContext($config_vars);
}

function 
ModifyKarmaSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
// Karma - On or off?
array('select''karmaMode'explode('|'$txt['smf64'])),
'',
// Who can do it.... and who is restricted by time limits?
array('int''karmaMinPosts'),
array('float''karmaWaitTime'),
array('check''karmaTimeRestrictAdmins'),
'',
// What does it look like?  [smite]?
array('text''karmaLabel'),
array('text''karmaApplaudLabel'),
array('text''karmaSmiteLabel'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=karma');
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=karma';
$context['settings_title'] = $txt['smf293'];

prepareDBSettingContext($config_vars);
}
function 
ModifyMemberColorLinksSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
// Standard Membercolor?
array('check''MemberColorLink'),
'',
//Some Stat Settings
array('check''MemberColorLatestMember'),
array('check''MemberColorStats'),
array('check''MemberColorWhoIsOnline'),
'',
//Thread and Boardsettings
array('check''MemberColorThreadOwner'),
array('check''MemberColorThreadLastPost'),
array('check''MemberColorThreadChild'),
'',
//Birthday and Calendar 
array('check''MemberColorBoardindex'),
array('check''MemberColorBirthday'),
'',
//Some Recent Things
array('check''MemberColorRecentOwner'),
array('check''MemberColorRecentLastPost'),
'',
// PM Colors
array('check''MemberColorInbox'),
array('check''MemberColorOutbox'),
'',
//Guest Color
array('text''MemberColorGuests'),
//Banned User Color
array('text''MemberColorBanned'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=MemberColorLinks');
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=MemberColorLinks';
$context['settings_title'] = $txt['MemberColorLinkHeadline'];

prepareDBSettingContext($config_vars);
}


function 
ModifyActionSettings()
{
global $sourcedir;
require_once($sourcedir '/CustomAction.php');
CustomActionSettings();
}


// --- Begin modification - UserCP ---
function ModifyUserCPSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
array('check''usercp_enable'),
           array (
'check''usercp_enablecontactadmin'),
           array(
'check''usercp_switchview'),
           array(
'check''usercp_usepm'),
           array(
'int''usercp_adminid'),
            
'',
             array(
'text''usercp_field1image'),
             array(
'text''usercp_field1url'),
             array(
'text''usercp_field1maintext'),
             array(
'text''usercp_field1summary'),
             array(
'check''usercp_field1enable'),
             
'',
             array(
'text''usercp_field2image'),
             array(
'text''usercp_field2url'),
             array(
'text''usercp_field2maintext'),
             array(
'text''usercp_field2summary'),
             array(
'check''usercp_field2enable'),
             
'',
             array(
'text''usercp_field3image'),
             array(
'text''usercp_field3url'),
             array(
'text''usercp_field3maintext'),
             array(
'text''usercp_field3summary'),
             array(
'check''usercp_field3enable'),
             
'',
             array(
'text''usercp_field4image'),
             array(
'text''usercp_field4url'),
             array(
'text''usercp_field4maintext'),
             array(
'text''usercp_field4summary'),
             array(
'check''usercp_field4enable'),
             
'',
   
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=usercp');
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=usercp';
$context['settings_title'] = $txt['usercp'];

prepareDBSettingContext($config_vars);
}
// --- End modification ---
function ModifyAeiouSettings()
{
global $txt$scripturl$context$settings$sc$db_prefix$modSettings;

// If the mod is enabled and we're not saving, query for mod status information
if (!isset($_GET['save']) && $modSettings['aeiou_enable'])
{
// Current time
$time time();

// Get the delete band
$request db_query("
SELECT count(*)
FROM 
{$db_prefix}members
WHERE lastLogin < "
. ($time 1814400) ."
AND aeiou_email < "
. ($time 1814400) ."
AND aeiou_count > 1
AND posts <= "
. (int) $modSettings['aeiou_underposts']. "
"
__FILE____LINE__);
list($deletion) = mysql_fetch_row($request);

// Create an array for the bands, with default values of 0
$temp = array(=> 0=> 0=> (int) $deletion);

// Tidy up
unset($deletion);
mysql_free_result($request);

// Get the email bands
$request db_query("
SELECT count(*) as no, aeiou_count
FROM 
{$db_prefix}members
WHERE lastLogin < "
. ($time 1814400) ."
AND aeiou_email < "
. ($time 1814400) ."
AND aeiou_count < 2
AND is_activated < 10
AND is_activated != 0
AND is_activated != 4
GROUP BY aeiou_count
ORDER BY aeiou_count ASC
"
__FILE____LINE__);

// No further emails, if not set already, stop the mod until tomorrow
if(mysql_num_rows($request) == 0)
{
// If not already, tell the mod to stop
if(!empty($modSettings['aeiou_stop']))
aeiou_update(array('stop' => 1));
// Change the variable for the remainder of this page
$modSettings['aeiou_stop'] = 1;
}
else
{
// Store the bands in the array created earlier
while($row mysql_fetch_assoc($request))
$temp[$row['aeiou_count']] = $row['no'];
// Tidy up
unset($row);

// The mod is set as stopped, but we discovered some emails, so re-activate us
if(!empty($modSettings['aeiou_stop']))
{
aeiou_update(array('stop' => 0));
// Change the variable for the remainder of this page
$modSettings['aeiou_stop'] = 0;
$reactivated 1;
}
}

// Prepare rows for the stats table
$items = array();

// Last ran
$items['aeiou_last_ran'] = ($modSettings['aeiou_locktimestamp'] == 0) ? $txt['aeiou_never'] : timeformat($modSettings['aeiou_locktimestamp'], true) ;

$again = ($modSettings['aeiou_locktimestamp'] == 0) ? $time $modSettings['aeiou_locktimestamp'];
// But if reached daily limit or is stopped we will start/check again tomorrow
if($modSettings['aeiou_day_max'] <= $modSettings['aeiou_day_sent'] || $modSettings['aeiou_stop'] == 1)
{
$date explode('-'date('Y-m-d'$again));
$tomorrow mktime(000$date[1], $date[2], $date[0]) + (60*60*24);
$items['aeiou_starts_again'] = timeformat($tomorrowtrue);
unset($date$tomorrow);

}
elseif($modSettings['aeiou_hour_max'] <= $modSettings['aeiou_hour_sent'])
{
// Or reached hourly limit we will start/check again next hour
$date explode('-'date('Y-m-d-h'$again));
$nexthour mktime($date[3], 00$date[1], $date[2], $date[0]) + (60*60);
$items['aeiou_starts_again'] = timeformat($nexthourtrue);
unset($date$nexthour);
}
else
// Else Can start again from previous + 5mins
$items['aeiou_starts_again'] = timeformat($again 300true) ;

// Emailed today with max in parenthesis
$items['aeiou_sent_day'] = $modSettings['aeiou_day_sent']
.' <span style="font-weight:normal;font-style:italic">('.$txt['aeiou_max'].': '.$modSettings['aeiou_day_max'].')</span>';
// Emailed this hour with max in parenthesis
$items['aeiou_sent_hour'] = $modSettings['aeiou_hour_sent']
.' <span style="font-weight:normal;font-style:italic">('.$txt['aeiou_max'].': '.$modSettings['aeiou_hour_max'].')</span>';

// Now setup the stats about no.s of email etc
$items['aeiou_awaiting_total'] = $temp[0] + $temp[1];
$items['aeiou_awaiting_initial_email'] = $temp[0];
$items['aeiou_awaiting_final_email'] = $temp[1];
$items['aeiou_awaiting_deletion'] = $temp[2] . (empty($modSettings['aeiou_delete']) ? ' <span style="color:red">'.$txt['aeiou_disabled'].'</span>' '' ) ; 

// Reasons for inactive
if(!empty($modSettings['aeiou_stop']))
$status $txt['aeiou_nofurtheremails'];
elseif($modSettings['aeiou_day_max'] <= $modSettings['aeiou_day_sent'])
$status $txt['aeiou_reacheddailylimit'];
elseif($modSettings['aeiou_hour_max'] <= $modSettings['aeiou_hour_sent'])
$status $txt['aeiou_reachedhourlylimit'];

// Is the mod Active? (even if enabled, it might not be active)
// If the mod was stopped, but on loading this page, we discovered more emails, show as re-activated
if(!empty($reactivated))
$status '<span style="color:darkgreen">'.$txt['aeiou_reactivated'].'</span>';
elseif(empty($status))
$status '<span style="color:darkgreen">'.$txt['aeiou_active'].'</span>';
else
// Inactive 
$status '<span style="color:maroon">'.$txt['aeiou_stopped'].'</span> - '$status;

// Header of the stats chunk and status
$chunk '<table cellpadding="1" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg"><td colspan="2">'
.$txt['aeiou_status'].': '.$status.'</td></tr>';

// Now build the chunk of html of our stats
foreach($items as $string => $value)
{
// Less emphasis on the sub-totals
$italic = ($string == 'aeiou_awaiting_initial_email' || $string == 'aeiou_awaiting_final_email') ? ;
// Add more rows to the existing chunk
$chunk .= '<tr class="windowbg"><td'.($italic ' style="font-weight:normal;font-style:italic"' '').' >'.$txt[$string].':</td><td'.($italic ' style="font-weight:normal;font-style:italic"' '').'>'.$value.'</td></tr>';
}
$chunk .= '</table><br />';


// Now for the last 10 people emailed
$request db_query("
SELECT ID_MEMBER, memberName, aeiou_email, aeiou_count
FROM 
{$db_prefix}members
WHERE aeiou_email != 0
ORDER BY aeiou_email DESC
LIMIT 10
"
__FILE____LINE__);

$chunk2 '<table cellpadding="1" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg"><td colspan="3">'
.$txt['aeiou_last10emailed'].'</td></tr>';
if(mysql_num_rows($request) == 0)
$chunk2 .= '<tr class="windowbg"><td colspan="3">'.$txt['aeiou_never'].'</td></tr>';
else
{
// Add each user as a row in the table
while($row mysql_fetch_assoc($request))
$chunk2 .= '<tr class="windowbg"><td><a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$row['memberName'].'</a></td><td style="font-weight:normal;">'.timeformat($row['aeiou_email'], true).'</td><td style="font-weight:normal;">'$txt['aeiou_'.( ($row['aeiou_count'] == 1) ? 'initial' 'final' )].'</td></tr>';
}
$chunk2 .= '</table><br />';

}
else
// If the mod is not enabled, don't show either as chunks.  use a space to prevent it being shown as a delimiter
$chunk $chunk2 ' ';

// Compile/Build some language strings/add to
// Avoids using html in the language files
$temp = array('initial_subject' => 'subject''initial_message' => 'message''final_subject' => 'subject''final_message' => 'message');
$add '<div class="smalltext">'.$txt['aeiou_email_desc1'].'<br />'.$txt['aeiou_email_desc2'].'<br />'.$txt['aeiou_email_desc3'].'</div>';
foreach($temp as $a => $b)
{
// Add the descriptions to the txt string
$txt['aeiou_'.$a] .= $add;
// Use the default message if we don't have a custom one saved
if(empty($modSettings['aeiou_'.$a]))
$modSettings['aeiou_'.$a] = !empty($txt['aeiou_default_'.$b]) ? $txt['aeiou_default_'.$b] : '' ;
}
// Tidy up
unset($temp$add$a);

// More descriptions to add with html
$temp = array('delete''underposts''hour_max''day_max''chunksize');
foreach($temp as $a)
$txt['aeiou_'.$a] .= '<div class="smalltext">'.$txt['aeiou_'.$a.'_desc'] .'</div>';

// Now the warning chunk.  Comprises of 4 parts.
$txt['aeiou_warning'] .= '<div class="smalltext">'$txt['aeiou_warning2'] .'<br />'.$txt['aeiou_warning3'].'<br />'.$txt['aeiou_warning4'].'</div>';

// The important array
$config_vars = array(
$chunk,
array('check''aeiou_enable'),
array('text''aeiou_initial_subject''30" style="width:95%'),
array('large_text''aeiou_initial_message''5" style="width:95%'),
array('text''aeiou_final_subject''30" style="width:95%'),
array('large_text''aeiou_final_message''5" style="width:95%'),
'',
array('check''aeiou_delete'),
array('int''aeiou_underposts'),
'',
$txt['aeiou_warning'],
array('int''aeiou_hour_max'),
array('int''aeiou_day_max'),
array('int''aeiou_chunksize'),
$chunk2,
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=aeiou');
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=aeiou';
$context['settings_title'] = $txt['aeiou_title'];

prepareDBSettingContext($config_vars);
}
function 
ModifyCustomBBCodeSettings()
{
global $sourcedir;

require_once $sourcedir '/CustomBBCode.php';

if (!empty($_GET['tag']))
EditCustomTag($_GET['tag']);
else
BrowseCustomTags();
}

?>



Thanks in Advance,
Sudhakar, Admin
www.itacumens.com
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Felic

Quote from: [SiNaN] on April 25, 2008, 03:09:53 AM
Felic, for the first question;

../Sources/SPortal.php

Find and Delete:

// Make sure guests can see this board.
...


Thanks for the reply.

Ya, I took a look at the code and tried that, but then guests can see the posts from hidden boards on the portal page. We do have a public board, but most of the forum boards are only accessible by subscription. What I'd like is the same thing for the Recent Posts on the Board News: posts seen according to permissions instead of a board restriction. That might be too complicated.

What about increasing the Recent Posts to 10 instead of 5? I tried to change the code to do that but couldn't figure it out.

cleanfiles

Hello again [SiNaN], I was wondering if it was possible to add blocks to the portal. Like add a txt block that i can use either html or php in or just plain txt. And have the ability to add as many of these blocks as required.
Thanks.

Drover

Quote from: [SiNaN] on April 25, 2008, 03:09:53 AM
Drover, can you attach your ModSettings.php file so that I can check the issue?

Attached!  Hope this is the right one this time...   :-\

Thanks again!


iceman~

Sinan Mate ... waiting for this to be released for SMF 2 ... Any info as yet ?
A wise monkey never monkies with another monkey's monkey

Eliana Tamerin

Yep, there is:

Quote from: [SiNaN] on April 25, 2008, 03:09:53 AM
[●ριмρєя12●], I hope so. I finished the block functions also. But I'm thinking of adding some new blocks. I hope it will be ready in a week. This version would be like a 2.0 Beta 3 Public version of SimplePortal v1.1 but also some changes made for the further versions.

.
.
.

And lastly for all of you; apologizes for the delay but I'm a poor university student who doesn't even has his own computer and fighting with the exams these days.

And until you hear more, that's the latest.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

cleanfiles

Quote from: cleanfiles on April 28, 2008, 06:46:12 AM
Hello again [SiNaN], I was wondering if it was possible to add blocks to the portal. Like add a txt block that i can use either html or php in or just plain txt. And have the ability to add as many of these blocks as required.
Thanks.
I tried duplicating the advertise block and that works fine, but I need to be able to edit the content....At the moment I just duplicates the content of the original block.
Is there a way to add to the admin panel the ability to edit the content of a second left or right add block?

[SiNaN]

asudhakar, I also couldn't find a problem there. Are the other settings work fine in your forum? Or it is only for SimplePortal?

Felic, it actually was working as it should. If you do not define the board news board id as a hidden board there will be no problem. Also you can increase the number of recent posts and topics from the Portal Settings.

Drover, your file is attached. Can you check it please?

iceman~, many things to do these days. I have some server-related problems in my own site. Need to update 3 of my mods urgently. Also trying to make a theme. Additionally my school. And the member color link add-on for the portal. But I'm working on updating the mod for 2.0 Beta 3 Public. I think it will be ready on time.

Thanks again Eliana. And congratulations as you are the support helper of the month. ;)

cleanfiles, hımmm, after duplicating them, a couple of things should be doubled also. :) For a new block as the advertise blocks, do this:

../Sources/ModSettings.php

Find:

array('check', 'advertiserighton'),
array('select', 'advertiserighttype', array(&$txt['advertisehtml'], &$txt['advertisephp'])),
array('large_text', 'advertiseright'),


After add:

array('check', 'customblock1on'),
array('select', 'customblock1type', array(&$txt['advertisehtml'], &$txt['advertisephp'])),
array('large_text', 'customblock1content'),


../Themes/default/languages/Modifications.english.php

Find:

?>

Before add:

$txt['customblock1on'] = 'Show custom block 1:';
$txt['customblock1type'] = 'Custom block 1 coding type:';
$txt['customblock1content'] = 'Custom block 1 content:';


../Themes/default/languages/SPortal.english.php

Find:

?>

Before add:

$txt['sp-customblock1'] = 'Custom Block 1 Name';

../SPortal.template.php

Add where you want the block to be shown:

if($modSettings['customblock1on'])
{
echo '
<!-- Custom Block -->
<div class="tborder">
<table class="bordercolor" width="100%">
<tr class="catbg">
<td style="padding: 5px;">', $txt['sp-customblock1'], '</td>
</tr>
<tr class="windowbg">
<td>';
if ($modSettings['customblock1type'] == 0)
echo $modSettings['customblock1content'];
else
eval ($modSettings['customblock1content']);
echo ' </td>
</tr>
</table>
</div>
<br />';
}
Former SMF Core Developer | My Mods | SimplePortal

Drover

#278
That seems to have taken care of part of the problem, Sinan.  It's letting me into the portal settings now, but doesn't save any changes I make there.

[SiNaN]

Quote from: Drover on April 29, 2008, 09:33:44 AM
Awesome, Sinan!

If SP doesn't quickly become the most downloaded mod, I don't know why.

Woow, another great comment Drover. :D

Wait for the SimplePortal 2.0. It would be compatible with the 2.0 Beta versions also I hope. 8)
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: