PDA

View Full Version : I want use date() in Plugin


SANBOR
06-07-2012, 08:48 AM
hi
I Want Replases function date() With jdate()
but i insert new plugin and i give error
Fatal error: Cannot redeclare date() in D:\xampp\htdocs\vbulletin\global.php(29) : eval()'d code on line 6

my new plugin is :
hook = global_start

function date($format, $timestamp = TIMENOW, $doyestoday = false, $locale = true, $adjust = true, $gmdate = false, $userinfo = '')
{
require_once(DIR . '/includes/jalali.php');
global $vbulletin, $calendarinfo, $vbphrase, $serveroffset, $blog, $start, $forum, $thread;
return jdate($format ,$timestamp=' ',$none='' ,$time_zone='' ,$tr_num='fa');
}


how do ?

kh99
06-07-2012, 11:12 AM
In php you can't replace a function by providing another implementation. You'll have to find another way to do whatever you're trying to do.

SANBOR
06-07-2012, 11:32 AM
Plz Help

kh99
06-07-2012, 11:50 AM
Well, I think most if not all displayed dates in vb use the function vbdate() in includes/functions.php, so maybe you could edit that function and change it to use your date function.

SANBOR
06-07-2012, 12:37 PM
I know this way.
I want to bring a total change in XML for a beginner users need not have to change the functions.php files!

--------------- Added 1339135309 at 1339135309 ---------------

Please help
Give me a way to offer a product I do not need to change the original files

--------------- Added 1339144872 at 1339144872 ---------------

Please help
Give me a way to offer a product I do not need to change the original files

SANBOR
06-08-2012, 03:51 PM
Please help
Give me a way to offer a product I do not need to change the original files

kh99
06-08-2012, 04:16 PM
Sorry, but I really don't think it's possible to replace all date calls in one place without editing the code. Another option would be to find every place that a date is displayed (or at least some important places that you are specifically interested in) and see if you can find hooks that allow you to modify them.

SANBOR
06-08-2012, 08:34 PM
for this

https://vborg.vbsupport.ru/showthread.php?t=284179

Please submit ideas and comments and other way