, )
.  1, 2
    ~
Advanced Hosters -

Napas
!
: 15.07.2008
: 859
# : 20, 2009 9:52 pm
brantozawr, ... 1 2008 2008

brantozawr
: 10.11.2008
: 126
# : 20, 2009 11:29 pm
Napas ():
brantozawr, ... 1 2008 2008



... ...

$d = $d1 + ($id-$id1)*$dx;

$id = $id1, $d1

$d1 mktime(0, 0, 0, 1, 1, 2008) ?

brantozawr
: 10.11.2008
: 126
# : 20, 2009 11:34 pm
... . , .... , , :

:

<?
    set_time_limit(0);

    $server="";
    $login  = "";
    $passwd = "";
    $dbname = "";
    $wp_posts = "main_wp_posts";

// 0, 0, 0, , ,
    $d1 = mktime(0, 0, 0, 1, 1, 2008);
    $d2 = mktime(0, 0, 0, 1, 20, 2009);

    $link = mysql_connect($server, $login, $passwd);
    mysql_select_db($dbname, $link);

    $query = "SELECT MIN(ID) as tmp FROM $wp_posts WHERE post_status='publish' AND post_type='post'";
    $res = mysql_query($query, $link);
    $a = mysql_fetch_array($res);
    $id1 = $a["tmp"];

    $query = "SELECT MAX(ID) as tmp FROM $wp_posts WHERE post_status='publish' AND post_type='post'";
    $res = mysql_query($query, $link);
    $a = mysql_fetch_array($res);
    $id2 = $a["tmp"];

    $query = "SELECT * FROM $wp_posts WHERE post_status='publish' AND post_type='post'";
    $res = mysql_query($query, $link);

    $dx = floor(($d2-$d1)/($id2-$id1));

    while ($a = mysql_fetch_array($res)) {
        $id = $a["ID"];

        $d = $d1 + ($id-$id1)*$dx;
        $d = date("Y-m-d H:i:s", $d);

        $query = "UPDATE $wp_posts SET post_date='".$d."', post_date_gmt='".$d."', post_modified='".$d."', post_modified_gmt='".$d."' WHERE ID='".$id."'";
        $res1 = mysql_query($query, $link);

    }

    mysql_close($link);

?>


Gyrus
: 16.10.2008
: 5
# : 21, 2009 12:24 am
Napas ():
Gyrus, (



... . - .

, :
:

<?php
set_time_limit(0);
include"wp-config.php";

$year="2008";
$month="2";
$day="12";

$pct=10;

$lyear="2009";
$lmonth="1";
$lday="21";

$result=mysql_query("Select * from `wp_posts`WHERE post_status='publish' AND post_type='post' ORDER BY `ID` ASC");
$z=mysql_num_rows($result);
$ldate=strtotime($lyear.'-'.$lmonth.'-'.$lday);
$sdate=strtotime($year.'-'.$month.'-'.$day);
$sec=floor(($ldate-$sdate)/$z);
$st=floor(($sec/100)*$pct);

for ($i=0; $i<$z; $i++) {
$sdate+=rand($st,$sec);
$post=mysql_fetch_object($result);
$ndate=date('Y-m-d H:i:s',$sdate);
$sql = "UPDATE `wp_posts` SET `post_date`='$ndate', `post_date_gmt`='$ndate', `post_modified`='$ndate', `post_modified_gmt`='$ndate' WHERE `ID`='".$post->id."'";
$results = mysql_query($sql);
}
?>



Smile , .. Smile

Napas
!
: 15.07.2008
: 859
# : 21, 2009 1:44 pm
, Smile
    ~