forked from science-ation/science-ation
Rollover the pagetext last-update date/time
Auto-create a pagetext entry in each language if they dont exist
This commit is contained in:
parent
5341801ce7
commit
f89fdffb12
@ -40,10 +40,13 @@
|
|||||||
$q=mysql_query("SELECT * FROM pagetext WHERE year='-1' ORDER BY textname");
|
$q=mysql_query("SELECT * FROM pagetext WHERE year='-1' ORDER BY textname");
|
||||||
while($r=mysql_fetch_object($q))
|
while($r=mysql_fetch_object($q))
|
||||||
{
|
{
|
||||||
mysql_query("INSERT INTO pagetext (textname,text,year) VALUES (
|
foreach($config['languages'] AS $lang=>$langname) {
|
||||||
'".mysql_escape_string($r->textname)."',
|
mysql_query("INSERT INTO pagetext (textname,textdescription,text,year,lang) VALUES (
|
||||||
'".mysql_escape_string($r->text)."',
|
'".mysql_escape_string($r->textname)."',
|
||||||
'".$config['FAIRYEAR']."')");
|
'".mysql_escape_string($r->text)."',
|
||||||
|
'".$config['FAIRYEAR']."',
|
||||||
|
'".mysql_escape_string($lang)."')");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,10 +88,11 @@
|
|||||||
$q=mysql_query("SELECT * FROM pagetext WHERE year='$currentfairyear'");
|
$q=mysql_query("SELECT * FROM pagetext WHERE year='$currentfairyear'");
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
while($r=mysql_fetch_object($q))
|
while($r=mysql_fetch_object($q))
|
||||||
mysql_query("INSERT INTO pagetext (textname,textdescription,text,year,lang) VALUES (
|
mysql_query("INSERT INTO pagetext (textname,textdescription,text,lastupdate,year,lang) VALUES (
|
||||||
'".mysql_escape_string($r->textname)."',
|
'".mysql_escape_string($r->textname)."',
|
||||||
'".mysql_escape_string($r->textdescription)."',
|
'".mysql_escape_string($r->textdescription)."',
|
||||||
'".mysql_escape_string($r->text)."',
|
'".mysql_escape_string($r->text)."',
|
||||||
|
'".mysql_escape_string($r->lastupdate)."',
|
||||||
'".mysql_escape_string($newfairyear)."',
|
'".mysql_escape_string($newfairyear)."',
|
||||||
'".mysql_escape_string($r->lang)."')");
|
'".mysql_escape_string($r->lang)."')");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user