Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Jalali Calander (Solar Or Shamsi) For vBulletin Details »»
Jalali Calander (Solar Or Shamsi) For vBulletin
Version: 2, by SANBOR SANBOR is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Category: Calendar Enhancements - Version: 4.x.x Rating:
Released: 06-07-2012 Last Update: 06-20-2012 Installs: 16
Uses Plugins Template Edits Auto-Templates
Code Changes Additional Files  
No support by the author.

Hello
I have made on Jalali Calander for vBulletin.

Thanks from:
1- Hamed Hadadian
2- Reza Gholampanahi (jdf.scr.ir)

jalali date on forum is completed but in cms and blogs completed up to 99%
For do this action must be in original vBulletin files to manually do the changes.
This changes is:

Code:
1. Upload 'jalali.php' to vBulletin's includes folder. EX: vb/includes
****************************************************************************




2. Upload 'hooks_jlalali.xml' to includes's xml folder. EX: vb/includes/xml
****************************************************************************




3. Open 'includes/functions.php' then
****************************************************************************
Find below, at first:
// ###### ...


Before add below:
require_once('jalali.php');
****************************************************************************
Find below:
$datefunc = 'strftime';


After add with:
($hook = vBulletinHook::fetch_hook('jalali_strftime')) ? eval($hook) : false;
****************************************************************************
Find below:
$datefunc = 'date';


After add with:
($hook = vBulletinHook::fetch_hook('jalali_date')) ? eval($hook) : false;
****************************************************************************
Find below:
$datetest = @date('n-j-Y', $timestamp - $hourdiff);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_datetest')) ? eval($hook) : false;
****************************************************************************




4. Open 'includes/functions_misc.php' then
****************************************************************************
Find below:
return mktime(intval($hours), intval($minutes), intval($seconds), intval($month), intval($day), intval($year)) + $vbulletin->options['hourdiff'];


Replace with:
if ( VB_AREA == 'AdminCP' or VB_AREA == 'ModCP' or THIS_SCRIPT == 'blog' ){
return mktime(intval($hours), intval($minutes), intval($seconds), intval($month), intval($day), intval($year)) + $vbulletin->options['hourdiff'];}
else{
if ($vbulletin->options['jalali_act'] == 1){
return jmktime(intval($hours), intval($minutes), intval($seconds), intval($month), intval($day), intval($year)) + $vbulletin->options['hourdiff'];}
else{
return mktime(intval($hours), intval($minutes), intval($seconds), intval($month), intval($day), intval($year)) + $vbulletin->options['hourdiff'];}
}
****************************************************************************
Find below:
$datearray = array(
	'day' => date('d', $timestamp),
	'month' => date('n', $timestamp),
	'year' => date('Y', $timestamp)
);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_datearray')) ? eval($hook) : false;
***************************************************************************




5. Open 'includes/class_dm_user.php' then
***************************************************************************
Find below:
function verify_birthday(&$birthday)
{


After Add Below:
($hook = vBulletinHook::fetch_hook('jalali_verify_birthday')) ? eval($hook) : false;
***************************************************************************





6. Open 'includes/class_userprofile.php' then
****************************************************************************
Find below:
$bday = explode('-', $userinfo['birthday']);

$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_bday')) ? eval($hook) : false;
****************************************************************************
Find below:
$this->registry->options['calformat1'] = mktimefix($this->registry->options['calformat1'], $bday[2]);

	
Before add with:
($hook = vBulletinHook::fetch_hook('jalali_tbday')) ? eval($hook) : false;
****************************************************************************




7. Open 'includes/class_postbit.php' then
****************************************************************************
Find below:
$this->cache['year'] = vbdate('Y', TIMENOW, false, false);
$this->cache['month'] = vbdate('n', TIMENOW, false, false);
$this->cache['day'] = vbdate('j', TIMENOW, false, false);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_bday')) ? eval($hook) : false;
****************************************************************************




8. open 'includes/blog_functions.php' then
****************************************************************************
Find below:
$startdate = getdate(gmmktime(12, 0, 0, $month, 1, $year));


Before add below:
($hook = vBulletinHook::fetch_hook('jalali_blog')) ? eval($hook) : false;
****************************************************************************
Find below:
if ($userinfo['showbirthday'] == 1 OR $userinfo['showbirthday'] == 2)
{
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_blog')) ? eval($hook) : false;
****************************************************************************




9. Open 'register.php' then
***************************************************************************
Find below:
$bday = explode('-', $birthday);


After add below:
($hook = vBulletinHook::fetch_hook('jalali_bday_register')) ? eval($hook) : false;
***************************************************************************
Find below:
if ($vbulletin->GPC['month'] == 0 OR $vbulletin->GPC['day'] == 0 OR !preg_match('#^\d{4}$#', $vbulletin->GPC['year']) OR $vbulletin->GPC['year'] < 1901 OR $vbulletin->GPC['year'] > $current['year'])
{
eval(standard_error(fetch_error('select_valid_dob', $current['year'])));
}


Replace with:
if ($vbulletin->options['jalali_act'] == 1){
$jalalicurrent['year'] = jdate('Y');
list ( $vbulletin->GPC['year'], $vbulletin->GPC['month'], $vbulletin->GPC['day'] ) = jalali_to_gregorian ( $vbulletin->GPC['year'], $vbulletin->GPC['month'], $vbulletin->GPC['day'] );
if ($vbulletin->GPC['month'] == 0 OR $vbulletin->GPC['day'] == 0 OR !preg_match('#^\d{4}$#', $vbulletin->GPC['year']) OR $vbulletin->GPC['year'] < 1901 OR $vbulletin->GPC['year'] > $current['year']){
eval(standard_error(fetch_error('jalali_select_valid_month_and_year', $jalalicurrent['year'])));}}
else{
if ($vbulletin->GPC['month'] == 0 OR $vbulletin->GPC['day'] == 0 OR !preg_match('#^\d{4}$#', $vbulletin->GPC['year']) OR $vbulletin->GPC['year'] < 1901 OR $vbulletin->GPC['year'] > $current['year']){
eval(standard_error(fetch_error('select_valid_dob', $current['year'])));}
}
***************************************************************************
Find below:
// pre-cache templates used by specific actions


Before add below:
require_once('./global.php');
($hook = vBulletinHook::fetch_hook('jalali_globaltemplates')) ? eval($hook) : false;
****************************************************************************
Find below:
$templater = vB_Template::create('register_verify_age');


After add with:
($hook = vBulletinHook::fetch_hook('jalali_templater_register')) ? eval($hook) : false;
****************************************************************************
Find below:
$templater = vB_Template::create('modifyprofile_birthday');


After add with:
($hook = vBulletinHook::fetch_hook('jalali_templater_modifyprofile')) ? eval($hook) : false;
****************************************************************************




10.Open 'private.php' then
****************************************************************************
Find below:
$templater = vB_Template::create('pm_filter');

After add with:
($hook = vBulletinHook::fetch_hook('jalali_templater_private')) ? eval($hook) : false;
****************************************************************************




11.Open 'announcement.php' then
****************************************************************************
Find below:
$templater = vB_Template::create('announcement_edit');


After add with:
($hook = vBulletinHook::fetch_hook('jalali_templater_announcement')) ? eval($hook) : false;
****************************************************************************
Find below:
$GLOBALS["{$date_type}_date_array"] = array(
	'day'   => vbdate('j', $announcementinfo["{$date_type}date"], false, false),
	'month' => vbdate('n', $announcementinfo["{$date_type}date"], false, false),
	'year'  => vbdate('Y', $announcementinfo["{$date_type}date"], false, false)
);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_fields')) ? eval($hook) : false;
****************************************************************************




12. Open 'profile.php' then
****************************************************************************
Find below:
if (date('Y') >= $birthday[2] AND $birthday[2] != '0000')
{
$year = $birthday[2];
}
	
After add with:
($hook = vBulletinHook::fetch_hook('jalali_set_birthday')) ? eval($hook) : false;
****************************************************************************
Find below:
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $birthday[2]);

Before add with:
($hook = vBulletinHook::fetch_hook('jalali_calformat')) ? eval($hook) : false;
****************************************************************************
Find below:
$actiontemplates['docustomize'] = $actiontemplates['customize'];


Before add below:
require_once('./global.php');
($hook = vBulletinHook::fetch_hook('jalali_actiontemplates')) ? eval($hook) : false;
****************************************************************************
Find below:
$birthdaybit = $templater->render();

After add with:
($hook = vBulletinHook::fetch_hook('jalali_templater_profile')) ? eval($hook) : false;
****************************************************************************




13. Open 'forum.php' then
****************************************************************************
Find below:
$today = vbdate('Y-m-d', TIMENOW, false, false);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_today')) ? eval($hook) : false;
****************************************************************************




14. Open 'memberlist.php' then
****************************************************************************
Find below:
if ($vbulletin->options['usememberlistadvsearch'])
{


After add below:
($hook = vBulletinHook::fetch_hook('jalali_usememberlistadvsearch')) ? eval($hook) : false;
****************************************************************************
Find below:
$today_year = vbdate('Y', TIMENOW, false, false);
$today_month = vbdate('n', TIMENOW, false, false);
$today_day = vbdate('j', TIMENOW, false, false);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_memberlistbits')) ? eval($hook) : false;
****************************************************************************
Find below:
$birthdayformat = mktimefix($vbulletin->options['calformat1'], $bday[2]);


After add with:
($hook = vBulletinHook::fetch_hook('jalali_birthdayformat')) ? eval($hook) : false;
****************************************************************************



15. Final: Goto Admin Control Panel then
****************************************************************************
Product Manager -> Add/Import Product -> Select jalali.xml and import it.




Enjoy it!

Then go to :
Settings > Options > jalali date > And click Yes

================================================== ==========================


For better display the Forum's proposed use this format :


Format For Date :
Code:
l d F y

Format For Time:
Code:
H:i

Format For Registration Date
Code:
F Y

Format For Birthdays with Year Specified
Code:
l j F Y

Format For Birthdays with Year Unspecified
Code:
j F

Log Date Format
Code:
F Y H:i
================================================== ===============
Other Format is :

Download Now

File Type: zip Jalali Calander Product.zip (13.2 KB, 54 views)

Screenshots

File Type: jpg announcement.jpg (41.4 KB, 0 views)
File Type: jpg birthday.jpg (60.7 KB, 0 views)
File Type: jpg blog.jpg (44.3 KB, 0 views)
File Type: jpg blog1.jpg (37.9 KB, 0 views)
File Type: jpg cms.jpg (83.5 KB, 0 views)
File Type: png info.png (7.0 KB, 0 views)
File Type: jpg private.jpg (64.1 KB, 0 views)
File Type: png profile.png (37.7 KB, 0 views)
File Type: jpg Cpanel.jpg (21.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
animcentral, Arianismmm, kavehch, Mehdi_Zakhire

Comments
  #12  
Old 08-09-2012, 09:10 PM
ecitizen's Avatar
ecitizen ecitizen is offline
 
Join Date: Nov 2011
Location: iran
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HI
thanks a lot.
it is very good
i hop the vbultin adding jalali and hijri calenders in vbulletin source .
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03951 seconds
  • Memory Usage 2,262KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (2)post_thanks_box
  • (4)post_thanks_box_bit
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (10)postbit_attachment
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete