Ahoj,
koukni se na siknese.cz
prihlas se pres facebook, nebo si zaloz profil,
prvně si udělám ve function.php nové funkce pro zápis do DB a funkci pro prave zmenu udaje datumu publikace a do kdy se bude zobrazovat.
function sqlupdate($query){
$con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(DB_NAME, $con);
mysql_query($query);
mysql_close($con);
}
function rePublish($id){
$sql='update '.DB_TABLE_PREFIX.'t_item set dt_pub_date=now(), dt_expiration=DATE_ADD( now(), INTERVAL 31 DAY) WHERE pk_i_id='.$id;
//echo $sql.'<br>';
sqlupdate($sql);
}
V php kodu das republish(id inzeratu); a je to....
no a v musis predelat defaultni razeni ne dle id, ale dt_pub_date a to sem popisoval pockej najdu tu na foru, uz sem to psal anglicky.
1
General help / Re: Changing ad publish date in SQL does not affect latest items order?
« Message by seton on July 17, 2012, 12:30:45 AM »
Quote from: maxo on May 22, 2012, 01:28:21 AM
I went into SQL and changed the publish date on an old ad to today's date. I thought that this would make the ad jump to the top of the latest items list. But the ad did not move from it's original order in the list. Is there another date being stored in the database that I'm missing? What I want to do is change the date of an ad to a future date so that it will stay at the top of the latest items list.
Thanks for any help.
Finaly i found where to change order
But is is in osclass code, not in theme.
In directory : oc-includes/osclass/model
is file: Search.php
there is approx on line 1085 this line:
$this->dao->orderBy(DB_TABLE_PREFIX.'t_item.pk_i_id', 'DESC');
so I comment this line by // and replace by this:
$srovnej=DB_TABLE_PREFIX.'t_item.dt_pub_date';
$this->dao->orderBy($srovnej, 'DESC');
It will solve your problem in current version OS-CLASS
but with new version it will be replaced.
Tony
Takze v oc-includes/osclass/model/search.php upravis viz par radek vyse.
A mas to.
Teda samozrejme, ze se dostanes do problemu jak toto volat..... ze , no ja patral v phpinfo() a nalezl jsem promenne, jenz potrebuji k dostani se zpet na tuto url... tedy na ten dany inzerat, na tlacitku mam formular se skrytymi promennymi url stranky, id inzeratu a buch vi s cim dal zavolam stranku, prectu si pos id inzeratu, url kam po provedeni zapisu do db presmeruji ihned na zpet na stranu, kde jsem klikl v editu itemu na tlacitko republish.
Nen9 to jednoduche, je to proste, pokud budes chtit kod, muzu dat.