Vai al contenuto
Max

3.4 Board Life Counter

Recommended Posts

Max

Salve ragazzi, avrei bisogno di un'aiutino, come da titolo ho installato questa hook però vorrei cambiare la data di partenza del mio nuovo forum, in sostanza adesso dice che il forum è online da poco più di 2 ore mentre io vorrei che combaciasse esattamente con le 24 ore correnti, in pratica avrei bisogno di sapere se si può inserire la data che vorrei io e cioè che il forum abbia avuto inizio con data 3 dicembre alle ore 00:00, questo è il file .xml:

<?xml version="1.0" encoding="utf-8"?>
<hookexport>
<hookdata>
<config>
<hook_name>(Pav32) Board Life Counter</hook_name>
<hook_desc/>
<hook_author>Pavulon</hook_author>
<hook_email>ips@pavulon.net</hook_email>
<hook_website>http://pavulon.net</hook_website>
<hook_update_check>http://pavulon.net/checkVersion.php?key=board_lc</hook_update_check>
<hook_requirements><![CDATA[a:3:{s:21:"required_applications";a:0:{}s:20:"hook_php_version_min";s:1:"0";s:20:"hook_php_version_max";s:0:"";}]]></hook_requirements>
<hook_version_human>1.1.0</hook_version_human>
<hook_version_long>10100</hook_version_long>
<hook_extra_data><![CDATA[a:5:{s:7:"display";a:3:{s:8:"settings";s:35:"Grupa ustawień: Board Life Counter";s:8:"language";s:249:"From forums_public_boards: blc_day1, blc_day2, blc_hour1, blc_hour2, blc_hour3, blc_minute1, blc_minute2, blc_minute3, blc_month1, blc_month2, blc_month3, blc_second1, blc_second2, blc_second3, blc_startup, blc_title, blc_year1, blc_year2, blc_year3";s:9:"templates";s:26:"Z skin_boards: hookBoardLC";}s:13:"settingGroups";a:1:{i:0;s:5:"blc_c";}s:8:"settings";a:8:{i:0;s:8:"blc_year";i:1;s:7:"blc_mon";i:2;s:7:"blc_day";i:3;s:8:"blc_hour";i:4;s:7:"blc_min";i:5;s:11:"blc_counter";i:6;s:11:"blc_startup";i:7;s:10:"blc_single";}s:8:"language";a:1:{s:20:"forums_public_boards";a:19:{s:0:"";s:8:"blc_day1";i:1;s:8:"blc_day2";i:2;s:9:"blc_hour1";i:3;s:9:"blc_hour2";i:4;s:9:"blc_hour3";i:5;s:11:"blc_minute1";i:6;s:11:"blc_minute2";i:7;s:11:"blc_minute3";i:8;s:10:"blc_month1";i:9;s:10:"blc_month2";i:10;s:10:"blc_month3";i:11;s:11:"blc_second1";i:12;s:11:"blc_second2";i:13;s:11:"blc_second3";i:14;s:11:"blc_startup";i:15;s:9:"blc_title";i:16;s:9:"blc_year1";i:17;s:9:"blc_year2";i:18;s:9:"blc_year3";}}s:9:"templates";a:1:{s:11:"skin_boards";a:1:{s:11:"hookBoardLC";s:11:"hookBoardLC";}}}]]></hook_extra_data>
<hook_key>board_lc</hook_key>
<hook_global_caches/>
</config>
</hookdata>
<hookfiles>
<file>
<hook_file_real>boardLC.php</hook_file_real>
<hook_type>templateHooks</hook_type>
<hook_classname>boardLC</hook_classname>
<hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:11:"skin_boards";s:12:"skinFunction";s:18:"boardIndexTemplate";s:4:"type";s:2:"if";s:2:"id";s:10:"showTotals";s:8:"position";s:9:"pre.endif";}]]></hook_data>
<hooks_source><![CDATA[<?php

/**
* <pre>
* (Pav32) Board Life Counter
* IP.Board v3.2.2
* Last Updated: September 13, 2011
* </pre>
*
* @author Konrad "Pavulon" Szproncel
* @copyright (c) 2011 Konrad "Pavulon" Szproncel
* @link http://forum.invisionize.pl
* @version 1.1.0 (Revision 10100)
*/

class boardLC
{
public $registry;
public $memberData;
public $settings;

public function __construct()
{
$this->registry = ipsRegistry::instance();
$this->settings =& $this->registry->fetchSettings();
$this->lang = $this->registry->getClass('class_localization');
}

public function getOutput()
{

}

public function replaceOutput( $output, $hook )
{
$hookpos = strpos( $output, $hook );
$pos = strrpos( substr( $output, 0, $hookpos ), '</li>' ) + 5;

if( $pos > 5 )
{
/* Init */
$data = array();

$start = $this->settings['board_start'];

/* date_diff_array */
$dda = $this->date_diff( $start, time() );

$forms = array( 'year', 'month', 'day', 'hour', 'minute' );

foreach( $forms as $form )
{
if ( $this->settings[ 'blc_' . $form ] && $dda[ $form ] )
{
$data['total_count'] .= $this->formDate( $dda[ $form ], $form );
}
}

$data['total_count'] = trim( $data['total_count'] );

$data['startup'] = date( 'j ', $start ) . $this->lang->words[ 'M_' . date( 'n', $start ) ] . date( ' Y', $start );

$html = $this->registry->output->getTemplate('boards')->hookBoardLC( $data );

$output = substr_replace( $output, $html, $pos, 0 );
}

return $output;
}

public function formDate( $value, $type )
{
$form = "";
switch ( $type )
{
case 'year':
if ( $value == 1 ) {
$form = $this->lang->words['blc_year1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_year2'];
} else {
$form = $this->lang->words['blc_year3'];
}
break;
case 'month':
if ( $value == 1 )
{
$form = $this->lang->words['blc_month1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_month2'];
} else {
$form = $this->lang->words['blc_month3'];
}
break;
case 'day':
if ( $value == 1 ) {
$form = $this->lang->words['blc_day1'];
} else {
$form = $this->lang->words['blc_day2'];
}
break;
case 'hour':
if ( $value ==1 ) {
$form = $this->lang->words['blc_hour1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_hour2'];
} else if ( $value < 22 ) {
$form = $this->lang->words['blc_hour3'];
} else {
$form = $this->lang->words['blc_hour2'];
}
break;
case 'minute':
if ( $value == 1 ) {
$form = $this->lang->words['blc_minute1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_minute2'];
} else {
$form = $this->lang->words['blc_minute3'];
}
break;
case 'second':
if ( $value == 1 ) {
$form = $this->lang->words['blc_second1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_second2'];
} else {
$form = $this->lang->words['blc_second3'];
}
break;
}

return "{$value} {$form} ";
}

/* by davix - http://www.php.net/manual/en/function.date-diff.php#93915 */
public function date_diff($d1, $d2)
{
/* compares two timestamps and returns array with differencies (year, month, day, hour, minute, second)
*/
//check higher timestamp and switch if neccessary
if ($d1 < $d2){
$temp = $d2;
$d2 = $d1;
$d1 = $temp;
}
else {
$temp = $d1; //temp can be used for day count if required
}
$d1 = date_parse(date("Y-m-d H:i:s",$d1));
$d2 = date_parse(date("Y-m-d H:i:s",$d2));
//seconds
if ($d1['second'] >= $d2['second']){
$diff['second'] = $d1['second'] - $d2['second'];
}
else {
$d1['minute']--;
$diff['second'] = 60-$d2['second']+$d1['second'];
}
//minutes
if ($d1['minute'] >= $d2['minute']){
$diff['minute'] = $d1['minute'] - $d2['minute'];
}
else {
$d1['hour']--;
$diff['minute'] = 60-$d2['minute']+$d1['minute'];
}
//hours
if ($d1['hour'] >= $d2['hour']){
$diff['hour'] = $d1['hour'] - $d2['hour'];
}
else {
$d1['day']--;
$diff['hour'] = 24-$d2['hour']+$d1['hour'];
}
//days
if ($d1['day'] >= $d2['day']){
$diff['day'] = $d1['day'] - $d2['day'];
}
else {
$d1['month']--;
$diff['day'] = date("t",$temp)-$d2['day']+$d1['day'];
}
//months
if ($d1['month'] >= $d2['month']){
$diff['month'] = $d1['month'] - $d2['month'];
}
else {
$d1['year']--;
$diff['month'] = 12-$d2['month']+$d1['month'];
}
//years
$diff['year'] = $d1['year'] - $d2['year'];
return $diff;
}
}
]]></hooks_source>
</file>
</hookfiles>
<hookextras_settings>
<setting>
<conf_is_title>1</conf_is_title>
<conf_title_title>(Pav32) Board Life Counter</conf_title_title>
<conf_title_desc>Settings for the hook (Pav32) Board Life Counter</conf_title_desc>
<conf_title_noshow>0</conf_title_noshow>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_title_app>core</conf_title_app>
<conf_title_tab>Hooks</conf_title_tab>
</setting>
<setting>
<conf_id>328</conf_id>
<conf_title>Counter Enabled?</conf_title>
<conf_description>Do you want to enable board counter?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_counter</conf_key>
<conf_value/>
<conf_default>0</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>2</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>325</conf_id>
<conf_title>Days</conf_title>
<conf_description>Do you want to display days?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_day</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>6</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>326</conf_id>
<conf_title>Hours</conf_title>
<conf_description>Do you want to display hours?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_hour</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>7</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>327</conf_id>
<conf_title>Minutes</conf_title>
<conf_description>Do you want to display minutes?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_minute</conf_key>
<conf_value/>
<conf_default>0</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>8</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>324</conf_id>
<conf_title>Months</conf_title>
<conf_description>Do you want to display months?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_month</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>5</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>329</conf_id>
<conf_title>Startup Date Enabled?</conf_title>
<conf_description>Do you want to enable startup date?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_startup</conf_key>
<conf_value/>
<conf_default>0</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>1</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>323</conf_id>
<conf_title>Years</conf_title>
<conf_description>Do you want to display years?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_year</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>4</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
</hookextras_settings>
<hookextras_language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_startup</word_key>
<word_default>Nascita Forum</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_title</word_key>
<word_default>Forum Online</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_second3</word_key>
<word_default>secondi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_second1</word_key>
<word_default>secondo</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_second2</word_key>
<word_default>secondi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_minute3</word_key>
<word_default>Minuti</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_minute2</word_key>
<word_default>Minuti</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_hour3</word_key>
<word_default>Ore</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_minute1</word_key>
<word_default>Minuto</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_hour2</word_key>
<word_default>Ore</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_hour1</word_key>
<word_default>Ora</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_day1</word_key>
<word_default>Giorno</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_day2</word_key>
<word_default>Giorni</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_month3</word_key>
<word_default>Mesi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_month2</word_key>
<word_default>Mesi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_month1</word_key>
<word_default>Mese</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_year3</word_key>
<word_default>Anni</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_year2</word_key>
<word_default>Anni</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_year1</word_key>
<word_default>Anno</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
</hookextras_language>
<hookextras_modules/>
<hookextras_help/>
<hookextras_templates>
<templates>
<template_group>skin_boards</template_group>
<template_content><![CDATA[<if test="$this->settings['blc_startup'] == 1">
<li class='clear'>
<span class='value'>{$data['startup']}</span>
{$this->lang->words['blc_startup']}
</li>
</if>
<if test="$this->settings['blc_counter'] == 1">
<li class='clear'>
<span class='value'>{$data['total_count']}</span>
{$this->lang->words['blc_title']}
</li>
</if>]]></template_content>
<template_name>hookBoardLC</template_name>
<template_data>$data</template_data>
<template_updated>1315918914</template_updated>
<template_removable>0</template_removable>
<template_added_to>0</template_added_to>
<template_user_added>0</template_user_added>
<template_user_edited>0</template_user_edited>
<template_master_key>root</template_master_key>
</templates>
</hookextras_templates>
<hookextras_css/>
<hookextras_tasks/>
<hookextras_database_create/>
<hookextras_database_alter/>
<hookextras_database_update/>
<hookextras_database_insert/>
</hookexport>

un sentito ringraziamento a chi mi aiuta ;)

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti
Enzo

Salve ragazzi, avrei bisogno di un'aiutino, come da titolo ho installato questa hook però vorrei cambiare la data di partenza del mio nuovo forum, in sostanza adesso dice che il forum è online da poco più di 2 ore mentre io vorrei che combaciasse esattamente con le 24 ore correnti, in pratica avrei bisogno di sapere se si può inserire la data che vorrei io e cioè che il forum abbia avuto inizio con data 3 dicembre alle ore 00:00, questo è il file .xml:

un sentito ringraziamento a chi mi aiuta ;)

Prova ad utilizzare questo e fammi sapere. Ciao


<?xml version="1.0" encoding="utf-8"?>
<hookexport>
<hookdata>
<config>
<hook_name>(Pav32) Board Life Counter</hook_name>
<hook_desc/>
<hook_author>Pavulon</hook_author>
<hook_email>ips@pavulon.net</hook_email>
<hook_website>http://pavulon.net</hook_website>
<hook_update_check>http://pavulon.net/checkVersion.php?key=board_lc</hook_update_check>
<hook_requirements><![CDATA[a:3:{s:21:"required_applications";a:0:{}s:20:"hook_php_version_min";s:1:"0";s:20:"hook_php_version_max";s:0:"";}]]></hook_requirements>
<hook_version_human>1.1.0</hook_version_human>
<hook_version_long>10100</hook_version_long>
<hook_extra_data><![CDATA[a:5:{s:7:"display";a:3:{s:8:"settings";s:35:"Grupa ustawień: Board Life Counter";s:8:"language";s:249:"From forums_public_boards: blc_day1, blc_day2, blc_hour1, blc_hour2, blc_hour3, blc_minute1, blc_minute2, blc_minute3, blc_month1, blc_month2, blc_month3, blc_second1, blc_second2, blc_second3, blc_startup, blc_title, blc_year1, blc_year2, blc_year3";s:9:"templates";s:26:"Z skin_boards: hookBoardLC";}s:13:"settingGroups";a:1:{i:0;s:5:"blc_c";}s:8:"settings";a:8:{i:0;s:8:"blc_year";i:1;s:7:"blc_mon";i:2;s:7:"blc_day";i:3;s:8:"blc_hour";i:4;s:7:"blc_min";i:5;s:11:"blc_counter";i:6;s:11:"blc_startup";i:7;s:10:"blc_single";}s:8:"language";a:1:{s:20:"forums_public_boards";a:19:{s:0:"";s:8:"blc_day1";i:1;s:8:"blc_day2";i:2;s:9:"blc_hour1";i:3;s:9:"blc_hour2";i:4;s:9:"blc_hour3";i:5;s:11:"blc_minute1";i:6;s:11:"blc_minute2";i:7;s:11:"blc_minute3";i:8;s:10:"blc_month1";i:9;s:10:"blc_month2";i:10;s:10:"blc_month3";i:11;s:11:"blc_second1";i:12;s:11:"blc_second2";i:13;s:11:"blc_second3";i:14;s:11:"blc_startup";i:15;s:9:"blc_title";i:16;s:9:"blc_year1";i:17;s:9:"blc_year2";i:18;s:9:"blc_year3";}}s:9:"templates";a:1:{s:11:"skin_boards";a:1:{s:11:"hookBoardLC";s:11:"hookBoardLC";}}}]]></hook_extra_data>
<hook_key>board_lc</hook_key>
<hook_global_caches/>
</config>
</hookdata>
<hookfiles>
<file>
<hook_file_real>boardLC.php</hook_file_real>
<hook_type>templateHooks</hook_type>
<hook_classname>boardLC</hook_classname>
<hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:11:"skin_boards";s:12:"skinFunction";s:18:"boardIndexTemplate";s:4:"type";s:2:"if";s:2:"id";s:10:"showTotals";s:8:"position";s:9:"pre.endif";}]]></hook_data>
<hooks_source><![CDATA[<?php
/**
* <pre>
* (Pav32) Board Life Counter
* IP.Board v3.2.2
* Last Updated: September 13, 2011
* </pre>
*
* @author Konrad "Pavulon" Szproncel
* @copyright (c) 2011 Konrad "Pavulon" Szproncel
* @link http://forum.invisionize.pl
* @version 1.1.0 (Revision 10100)
*/
class boardLC
{
public $registry;
public $memberData;
public $settings;
public function __construct()
{
$this->registry = ipsRegistry::instance();
$this->settings =& $this->registry->fetchSettings();
$this->lang = $this->registry->getClass('class_localization');
}
public function getOutput()
{
}
public function replaceOutput( $output, $hook )
{
$hookpos = strpos( $output, $hook );
$pos = strrpos( substr( $output, 0, $hookpos ), '</li>' ) + 5;
if( $pos > 5 )
{
/* Init */
$data = array();
$start = $this->settings['board_start'];
/* date_diff_array */
$dda = $this->date_diff( $start, time() );
$forms = array( 'year', 'month', 'day', 'hour', 'minute' );
foreach( $forms as $form )
{
if ( $this->settings[ 'blc_' . $form ] && $dda[ $form ] )
{
$data['total_count'] .= $this->formDate( $dda[ $form ], $form );
}
}
$data['total_count'] = trim( $data['total_count'] );
$data['startup'] = date( 'j ', $start ) . $this->lang->words[ 'M_' . date( 'n', $start ) ] . date( ' Y', $start );
$html = $this->registry->output->getTemplate('boards')->hookBoardLC( $data );
$output = substr_replace( $output, $html, $pos, 0 );
}
return $output;
}
public function formDate( $value, $type )
{
$form = "";
switch ( $type )
{
case 'year':
if ( $value == 1 ) {
$form = $this->lang->words['blc_year1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_year2'];
} else {
$form = $this->lang->words['blc_year3'];
}
break;
case 'month':
if ( $value == 1 )
{
$form = $this->lang->words['blc_month1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_month2'];
} else {
$form = $this->lang->words['blc_month3'];
}
break;
case 'day':
if ( $value == 1 ) {
$form = $this->lang->words['blc_day1'];
} else {
$form = $this->lang->words['blc_day2'];
}
break;
case 'hour':
if ( $value ==1 ) {
$form = $this->lang->words['blc_hour1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_hour2'];
} else if ( $value < 22 ) {
$form = $this->lang->words['blc_hour3'];
} else {
$form = $this->lang->words['blc_hour2'];
}
break;
case 'minute':
if ( $value == 1 ) {
$form = $this->lang->words['blc_minute1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_minute2'];
} else {
$form = $this->lang->words['blc_minute3'];
}
break;
case 'second':
if ( $value == 1 ) {
$form = $this->lang->words['blc_second1'];
} else if ( $value < 5 ) {
$form = $this->lang->words['blc_second2'];
} else {
$form = $this->lang->words['blc_second3'];
}
break;
}
return "{$value} {$form} ";
}
/* by davix - http://www.php.net/manual/en/function.date-diff.php#93915 */
public function date_diff($d1, $d2)
{
/* compares two timestamps and returns array with differencies (year, month, day, hour, minute, second)
*/
//check higher timestamp and switch if neccessary
if ($d1 < $d2){
$temp = $d2;
$d2 = $d1;
$d1 = $temp;
}
else {
$temp = $d1; //temp can be used for day count if required
}
$d1 = date_parse(date("d-m-Y H:i",$d1));
$d2 = date_parse(date("d-m-Y H:i",$d2));
//seconds
if ($d1['second'] >= $d2['second']){
$diff['second'] = $d1['second'] - $d2['second'];
}
else {
$d1['minute']--;
$diff['second'] = 60-$d2['second']+$d1['second'];
}
//minutes
if ($d1['minute'] >= $d2['minute']){
$diff['minute'] = $d1['minute'] - $d2['minute'];
}
else {
$d1['hour']--;
$diff['minute'] = 60-$d2['minute']+$d1['minute'];
}
//hours
if ($d1['hour'] >= $d2['hour']){
$diff['hour'] = $d1['hour'] - $d2['hour'];
}
else {
$d1['day']--;
$diff['hour'] = 24-$d2['hour']+$d1['hour'];
}
//days
if ($d1['day'] >= $d2['day']){
$diff['day'] = $d1['day'] - $d2['day'];
}
else {
$d1['month']--;
$diff['day'] = date("t",$temp)-$d2['day']+$d1['day'];
}
//months
if ($d1['month'] >= $d2['month']){
$diff['month'] = $d1['month'] - $d2['month'];
}
else {
$d1['year']--;
$diff['month'] = 12-$d2['month']+$d1['month'];
}
//years
$diff['year'] = $d1['year'] - $d2['year'];
return $diff;
}
}
]]></hooks_source>
</file>
</hookfiles>
<hookextras_settings>
<setting>
<conf_is_title>1</conf_is_title>
<conf_title_title>(Pav32) Board Life Counter</conf_title_title>
<conf_title_desc>Settings for the hook (Pav32) Board Life Counter</conf_title_desc>
<conf_title_noshow>0</conf_title_noshow>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_title_app>core</conf_title_app>
<conf_title_tab>Hooks</conf_title_tab>
</setting>
<setting>
<conf_id>328</conf_id>
<conf_title>Counter Enabled?</conf_title>
<conf_description>Do you want to enable board counter?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_counter</conf_key>
<conf_value/>
<conf_default>0</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>2</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>325</conf_id>
<conf_title>Days</conf_title>
<conf_description>Do you want to display days?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_day</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>6</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>326</conf_id>
<conf_title>Hours</conf_title>
<conf_description>Do you want to display hours?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_hour</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>7</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>327</conf_id>
<conf_title>Minutes</conf_title>
<conf_description>Do you want to display minutes?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_minute</conf_key>
<conf_value/>
<conf_default>0</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>8</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>324</conf_id>
<conf_title>Months</conf_title>
<conf_description>Do you want to display months?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_month</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>5</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>329</conf_id>
<conf_title>Startup Date Enabled?</conf_title>
<conf_description>Do you want to enable startup date?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_startup</conf_key>
<conf_value/>
<conf_default>0</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>1</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
<setting>
<conf_id>323</conf_id>
<conf_title>Years</conf_title>
<conf_description>Do you want to display years?</conf_description>
<conf_group>39</conf_group>
<conf_type>yes_no</conf_type>
<conf_key>blc_year</conf_key>
<conf_value/>
<conf_default>1</conf_default>
<conf_extra/>
<conf_evalphp/>
<conf_protected>1</conf_protected>
<conf_position>4</conf_position>
<conf_start_group/>
<conf_add_cache>1</conf_add_cache>
<conf_keywords/>
<conf_title_keyword>blc_c</conf_title_keyword>
<conf_is_title>0</conf_is_title>
</setting>
</hookextras_settings>
<hookextras_language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_startup</word_key>
<word_default>Nascita Forum</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_title</word_key>
<word_default>Forum Online</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_second3</word_key>
<word_default>secondi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_second1</word_key>
<word_default>secondo</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_second2</word_key>
<word_default>secondi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_minute3</word_key>
<word_default>Minuti</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_minute2</word_key>
<word_default>Minuti</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_hour3</word_key>
<word_default>Ore</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_minute1</word_key>
<word_default>Minuto</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_hour2</word_key>
<word_default>Ore</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_hour1</word_key>
<word_default>Ora</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_day1</word_key>
<word_default>Giorno</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_day2</word_key>
<word_default>Giorni</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_month3</word_key>
<word_default>Mesi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_month2</word_key>
<word_default>Mesi</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_month1</word_key>
<word_default>Mese</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_year3</word_key>
<word_default>Anni</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_year2</word_key>
<word_default>Anni</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
<language>
<word_app>forums</word_app>
<word_pack>public_boards</word_pack>
<word_key>blc_year1</word_key>
<word_default>Anno</word_default>
<word_custom/>
<word_js>0</word_js>
</language>
</hookextras_language>
<hookextras_modules/>
<hookextras_help/>
<hookextras_templates>
<templates>
<template_group>skin_boards</template_group>
<template_content><![CDATA[<if test="$this->settings['blc_startup'] == 1">
<li class='clear'>
<span class='value'>{$data['startup']}</span>
{$this->lang->words['blc_startup']}
</li>
</if>
<if test="$this->settings['blc_counter'] == 1">
<li class='clear'>
<span class='value'>{$data['total_count']}</span>
{$this->lang->words['blc_title']}
</li>
</if>]]></template_content>
<template_name>hookBoardLC</template_name>
<template_data>$data</template_data>
<template_updated>1315918914</template_updated>
<template_removable>0</template_removable>
<template_added_to>0</template_added_to>
<template_user_added>0</template_user_added>
<template_user_edited>0</template_user_edited>
<template_master_key>root</template_master_key>
</templates>
</hookextras_templates>
<hookextras_css/>
<hookextras_tasks/>
<hookextras_database_create/>
<hookextras_database_alter/>
<hookextras_database_update/>
<hookextras_database_insert/>
</hookexport>

Modificato da Askancy

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti
Askancy

Ciao, no, non è cambiato nulla.

Devi cambiare la data di registrazione dell'utente ID 1, come si può vedere da:


public $registry;
public $memberData;

Sinceramente non mi ricordo, ma mi pare che da Amministrazione si possa cambiare, sennò devi entrare su phpmyadmin e cambiare la data di registrazione attraverso la tabella... Ma tutto questo casino perchè?

edit: la prossima volta mettete i codici lunghi sotto spoiler, perchè io ho dovuto scorrere il codice postato da max, il codice di enzo e in più aveva citato il codice di max, praticamente mi sono finito la rotellina del mouse...

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti
Max

Hai ragione....sorry, non mi è proprio venuto in mente di mettere il codice sotto spoiler :unsure:

comunque tutto questo per avere la data che coincida con l'ora di internet, per esempio a me personalmente vedere il forum online da 3 ore e vedere che sono per esempio le 18 non ha senso, sarebbe meglio, almeno dal punto di vista visivo, vedere il forum online da 18 ore e vedere l'ora di internet che segna le 18....tutto qui ^_^

in phpmyadmin non saprei dove cercare.

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti
Max

ho provato a cambiare la data di registrazione in phpmyadmin con un timestamp inserendo la data che volevo io ma non è cambiato nulla,

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Crea un account o accedi per lasciare un commento

You need to be a member in order to leave a comment

Crea un account

Iscriviti per un nuovo account nella nostra comunità. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora

×