Author: frik85
Date: Mon Aug 27 18:35:02 2007
New Revision: 28600
URL:
http://svn.reactos.org/svn/reactos?rev=28600&view=rev
Log:
RosCMS update:
* several issues fixed
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php
trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php
trunk/web/reactos.org/htdocs/roscms/inc/user_login.php
trunk/web/reactos.org/htdocs/roscms/inc/usergroups.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php Mon Aug 27 18:35:02 2007
@@ -74,6 +74,8 @@
switch ($RosCMS_GET_d_flag) {
default:
+ //echo "<p>asasas: ".$RosCMS_GET_d_r_id." |
".strpos($RosCMS_GET_d_r_id, "tr")."</p>";
+
if (strpos($RosCMS_GET_d_r_id, "tr") === false) {
// normal (contains NO "tr")
show_edit_data();
@@ -83,24 +85,31 @@
}
else {
// translation mode (contains "tr")
- $temp_rev_id = substr($RosCMS_GET_d_r_id, 2, (strlen($RosCMS_GET_d_r_id)-2));
-
+ $temp_rev_id = substr($RosCMS_GET_d_r_id, 2);
+
+
+ if ($RosCMS_GET_debug) echo "<p>rev-id: ".$temp_rev_id." |
".is_numeric($temp_rev_id)."</p>";
+
$query_get_rev = mysql_query("SELECT data_id, rev_language
FROM data_revision
WHERE rev_id = ".mysql_real_escape_string($temp_rev_id)."
LIMIT 1;");
$result_get_rev = mysql_fetch_array($query_get_rev);
-
+
+ if ($RosCMS_GET_debug) echo "<p>data-id:
".$result_get_rev['data_id']."</p>";
if ($RosCMS_GET_debug) echo "<p>cur_revid: ".$temp_rev_id.";
cur_dataid: ".$result_get_rev['data_id']."
[".$result_get_rev['rev_language']."]</p>";
if (roscms_security_check_kind ($result_get_rev['data_id'],
"trans")) {
+ //echo "<p>security check passed</p>";
if (move_to_archive($result_get_rev['data_id'], $temp_rev_id, 1 /* copy
mode */)) {
+ //echo "<p>copy process passed</p>";
$query_get_new_rev = mysql_query("SELECT *
FROM data_revision
WHERE data_id =
".mysql_real_escape_string($result_get_rev['data_id'])."
AND rev_usrid =
".mysql_real_escape_string($roscms_intern_account_id)."
+ AND rev_version = 0
AND rev_language =
'".mysql_real_escape_string($RosCMS_GET_d_r_lang)."'
AND rev_date =
'".mysql_real_escape_string(date("Y-m-d"))."'
ORDER BY rev_id DESC
@@ -922,7 +931,20 @@
$tmp_number++;
//echo "<p>dyn-nbr: ".$tmp_number."</p>";
+
+ $tmp_number_sort = "";
+ for ($i = strlen($tmp_number); $i < 5; $i++) {
+ $tmp_number_sort .= "0";
+ }
+ $tmp_number_sort .= $tmp_number;
+
+ //echo "<p>strlen: ".strlen($tmp_number)."</p>";
+ //echo "<p>number_sort: ".$tmp_number_sort."</p>";
+
tag_add($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, "number", $tmp_number,
"-1");
+ tag_add($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, "number_sort",
$tmp_number_sort, "-1");
+ tag_add($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, "pub_date",
date("Y-m-d"), "-1");
+ tag_add($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, "pub_user",
$roscms_intern_account_id, "-1");
if ($RosCMS_GET_debug) echo "<p>add dynamic content number:
".$tmp_number."</p>";
@@ -1069,9 +1091,9 @@
<ul style="font-size:9px;"><li>Type: <?php echo
$result_diff2_data['data_type']; ?></li><li>Language: <?php echo
$result_diff2_data['lang_name']; ?></li><li>User: <?php echo
$result_diff2_data['user_name']; ?></li><?php if
($roscms_security_level > 1) { ?><li>ID: <?php echo
$result_diff2_data['rev_id']; ?></li><?php } ?></ul>
</td></tr>
</table>
- <div id="frmeditdiff1" style="display: none;"><?php echo
$result_diff1_data_text['text_content']; ?></div>
- <div id="frmeditdiff2" style="display: none; "><?php echo
$result_diff2_data_text['text_content']; ?></div>
- <div style="display: block; border-width: 1px; border-bottom: 1px solid #bbb;
border-right: 1px solid #bbb; border-top: 1px solid #e3e3e3; border-left: 1px solid
#e3e3e3; background: #F2F2F2 none repeat scroll 0%;"><div
style="margin:10px; font-size:9px;"
id="frmeditdiff"> </div>
+ <div><pre id="frmeditdiff1" style="display:
none;"><?php echo $result_diff1_data_text['text_content'];
?></pre></div>
+ <div><pre id="frmeditdiff2" style="display: none;
"><?php echo $result_diff2_data_text['text_content'];
?></pre></div>
+ <div style="display: block; border-width: 1px; border-bottom: 1px solid #bbb;
border-right: 1px solid #bbb; border-top: 1px solid #e3e3e3; border-left: 1px solid
#e3e3e3; background: #F2F2F2 none repeat scroll 0%;"><pre
style="margin:10px; font-size:9px; font-family:Arial, Helvetica, sans-serif;"
id="frmeditdiff"> </pre>
</div></div>
<?php
@@ -1146,14 +1168,15 @@
$temp_cur_lang = "";
- $query_diff1_cbm = mysql_query("SELECT d.data_id, d.data_name, r.rev_id,
r.rev_language, r.rev_version, r.rev_date, u.user_name
+ $query_diff1_cbm = mysql_query("SELECT d.data_id, d.data_name, r.rev_id,
r.rev_language, r.rev_version, r.rev_date, u.user_name, l.lang_name
FROM data_".$tmp_a2." d, data_revision".$tmp_a." r,
languages l, users u
WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
AND d.data_type =
'".mysql_real_escape_string($tmp_d_type)."'
AND r.data_id = d.data_id
AND r.rev_language = l.lang_id
+ AND r.rev_version > 0
AND u.user_id = r.rev_usrid
- ORDER BY r.rev_datetime DESC;");
+ ORDER BY l.lang_name ASC, r.rev_datetime DESC;");
while ($result_diff_cbm = mysql_fetch_array($query_diff1_cbm)) {
if ($result_diff_cbm['rev_language'] != $temp_cur_lang) {
if ($temp_cur_lang != "") {
@@ -1166,7 +1189,7 @@
LIMIT 1;");
$result_cur_lang = mysql_fetch_array($query_cur_lang);
- echo "<optgroup
label=\"".$result_cur_lang['lang_name']."\">";
+ echo "<optgroup
label=\"".$result_diff_cbm['lang_name']."\">";
$temp_cur_lang = $result_diff_cbm['rev_language'];
}
@@ -1280,9 +1303,9 @@
$query_revision_stable = mysql_query("SELECT *
FROM data_revision
WHERE data_id =
'".mysql_real_escape_string($result_rev_data['data_id'])."'
+ AND rev_version > 0
AND rev_language =
'".mysql_real_escape_string($result_rev_data['rev_language'])."'
- AND rev_version > 0
- ORDER BY rev_id DESC
+ ORDER BY rev_version DESC, rev_id DESC
LIMIT 1;");
$result_revision_stable = mysql_fetch_array($query_revision_stable);
@@ -1305,9 +1328,14 @@
transfer_tags($result_revision_stable['data_id'],
$result_revision_stable['rev_id'], $result_rev_data['data_id'],
$result_rev_data['rev_id'], false);
// move old revision to archive
- move_to_archive($result_revision_stable['data_id'],
$result_revision_stable['rev_id'], 0);
- if ($RosCMS_GET_debug) echo
"<p>deleteRevision(".$result_revision_stable['rev_id'].");</p>";
- deleteRevision($result_revision_stable['rev_id']);
+ if (move_to_archive($result_revision_stable['data_id'],
$result_revision_stable['rev_id'], 0)) {;
+ if ($RosCMS_GET_debug) echo
"<p>deleteRevision(".$result_revision_stable['rev_id'].");</p>";
+ deleteRevision($result_revision_stable['rev_id']);
+ }
+ else {
+ log_event_medium("move_to_archive() failed: data-id
".$result_revision_stable['data_id'].", rev-id
".$result_revision_stable['rev_id'].log_prep_info($result_revision_stable['data_id'],
$result_revision_stable['rev_id'])."{changetags}");
+ echo "Process not successful :S";
+ }
}
// update the version number
@@ -1358,7 +1386,7 @@
global $roscms_intern_account_id;
global $RosCMS_GET_d_r_lang;
global $RosCMS_GET_debug;
-
+
$d_id_org = $d_id;
$d_revid_org = $d_revid;
$d_name = "";
@@ -1537,6 +1565,8 @@
// data_tag
transfer_tags($d_id_org, $d_revid_org, $d_id, $d_revid, $tmp_archive);
+ if ($RosCMS_GET_debug) echo "\n<p>transfer_tags(".$d_id_org.",
".$d_revid_org.", ".$d_id.", ".$d_revid.",
".$tmp_archive.")</p>";
+
if ($tm_mode > 0) {
if ($RosCMS_GET_debug) echo "\n<p>change status to draft</p>";
@@ -1549,11 +1579,15 @@
function transfer_tags($d_id_org, $d_revid_org, $d_id, $d_revid, $archive) {
global $RosCMS_GET_debug;
+
+ if ($RosCMS_GET_debug) echo "\n<p>transfer_tags(".$d_id_org.",
".$d_revid_org.", ".$d_id.", ".$d_revid.",
".$archive.") {...}</p>";
if ($archive == true) {
+ if ($RosCMS_GET_debug) echo "\n<p>transfer_tags: archive
mode</p>";
$h_a = "_a";
}
else {
+ if ($RosCMS_GET_debug) echo "\n<p>transfer_tags: normal
mode</p>";
$h_a = "";
}
@@ -1809,7 +1843,7 @@
}
}
$t_counter_etagusr = $result_edit_mef_data_tag['tag_usrid'];
- echo
"<b>".ucfirst($result_edit_mef_data_tag['tn_name']).":</b> ".$result_edit_mef_data_tag['tv_value'];
+ echo
"<b>".$result_edit_mef_data_tag['tn_name'].":</b> ".$result_edit_mef_data_tag['tv_value'];
// show delete button
if (($roscms_security_level > 1 &&
$result_edit_mef_data_tag['tag_usrid'] == "0") || // allow to delete
label if SecLev > 1
@@ -1954,27 +1988,22 @@
$temp_cur_lang = "";
- $query_diff1_cbm = mysql_query("SELECT d.data_id, d.data_name, r.rev_id,
r.rev_language,r.rev_version, r.rev_datetime, u.user_name
+ $query_diff1_cbm = mysql_query("SELECT d.data_id, d.data_name, r.rev_id,
r.rev_language,r.rev_version, r.rev_datetime, u.user_name, l.lang_name
FROM data_".$tmp_a2." d, data_revision".$tmp_a." r,
languages l, users u
WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
AND d.data_type =
'".mysql_real_escape_string($tmp_d_type)."'
AND r.data_id = d.data_id
AND r.rev_language = l.lang_id
+ AND r.rev_version > 0
AND u.user_id = r.rev_usrid
- ORDER BY r.rev_datetime DESC;");
+ ORDER BY l.lang_name ASC, r.rev_datetime DESC;");
while ($result_diff_cbm = mysql_fetch_array($query_diff1_cbm)) {
if ($result_diff_cbm['rev_language'] != $temp_cur_lang) {
if ($temp_cur_lang != "") {
echo "</ul>";
}
- $query_cur_lang = mysql_query("SELECT *
- FROM languages
- WHERE lang_id =
'".mysql_real_escape_string($result_diff_cbm['rev_language'])."'
- LIMIT 1;");
- $result_cur_lang = mysql_fetch_array($query_cur_lang);
-
- echo
"<p><b>".$result_cur_lang['lang_name']."</b></p><ul>";
+ echo
"<p><b>".$result_diff_cbm['lang_name']."</b></p><ul>";
$temp_cur_lang = $result_diff_cbm['rev_language'];
}
@@ -2123,6 +2152,7 @@
global $roscms_security_level;
global $RosCMS_GET_d_id;
global $RosCMS_GET_d_r_id;
+ global $RosCMS_GET_d_arch;
global $h_a;
global $h_a2;
?>
@@ -2198,42 +2228,115 @@
<?php
}
- if ($t_text_lang != $roscms_standard_language) {
+ //echo "<p>".$t_text_lang." vs.
".$roscms_standard_language."</p>";
+
+ //if ($t_text_lang != $roscms_standard_language) {
+ $query_get_data_name = mysql_query("SELECT data_name, data_type
+ FROM data_".$h_a2."
+ WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
+ LIMIT 1;");
+ $result_get_data_name = mysql_fetch_array($query_get_data_name);
+
+ if ($RosCMS_GET_d_arch) { // archive mode
+ $query_get_data_name = mysql_query("SELECT data_name, data_type
+ FROM data_
+ WHERE data_name =
'".mysql_real_escape_string($result_get_data_name['data_name'])."'
+ AND data_type =
'".mysql_real_escape_string($result_get_data_name['data_type'])."'
+ LIMIT 1;");
+ $result_get_data_name = mysql_fetch_array($query_get_data_name);
+
+ $tmp_d_name = $result_get_data_name['data_name'];
+ $tmp_d_type = $result_get_data_name['data_type'];
+ }
+ else {
+ $tmp_d_name = $result_get_data_name['data_name'];
+ $tmp_d_type = $result_get_data_name['data_type'];
+ }
+
+
$query_choose_diff_count = mysql_query("SELECT COUNT(*)
- FROM data_revision".$h_a."
- WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
- ORDER BY rev_id DESC;");
+ FROM data_a d, data_revision_a r
+ WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
+ AND d.data_id = r.data_id
+ AND r.rev_version > 0
+ AND r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
+ ORDER BY r.rev_id DESC;");
$result_choose_diff_count = mysql_fetch_row($query_choose_diff_count);
- if ($result_choose_diff_count[0] <= 1) {
+
+ $query_choose_diff_count_ar = mysql_query("SELECT COUNT(*)
+ FROM data_a d, data_revision_a r
+ WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
+ AND d.data_id = r.data_id
+ AND r.rev_version > 0
+ AND r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
+ ORDER BY r.rev_id DESC;");
+ $result_choose_diff_count_ar = mysql_fetch_row($query_choose_diff_count_ar);
+
+ if ($result_choose_diff_count[0] <= 0 || $result_choose_diff_count[0] <= 0) {
?>
- <span id="bshowdiff" class="frmeditbutton"
onclick="diffentries3(<?php echo $RosCMS_GET_d_r_id .",".
$RosCMS_GET_d_r_id; ?>)"><img id="bshowdiffi"
src="images/tab_closed.gif" alt="" style="width:11px;
height:11px; border:0px;" /> Compare</span> (no related <?php
echo strtolower($roscms_standard_language_full); ?> entry found)
+ <span id="bshowdiff" class="frmeditbutton"
onclick="diffentries3(<?php echo $RosCMS_GET_d_r_id .",".
$RosCMS_GET_d_r_id; ?>)"><img id="bshowdiffi"
src="images/tab_closed.gif" alt="" style="width:11px;
height:11px; border:0px;" /> Compare</span> (no related <?php
echo strtolower($roscms_standard_language_full); ?> entry, choose yourself)
<?php
}
else {
- $query_choose_diff = mysql_query("SELECT rev_id
- FROM data_revision".$h_a."
- WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
- ORDER BY rev_id DESC
- LIMIT 0 , 2;");
- $result_choose_diff1 = mysql_fetch_array($query_choose_diff);
- $result_choose_diff2 = mysql_fetch_array($query_choose_diff);
+ if ($RosCMS_GET_d_arch) {
+ $query_choose_diff_ar = mysql_query("SELECT r.rev_id
+ FROM data_a d, data_revision_a r
+ WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
+ AND d.data_id = r.data_id
+ AND r.rev_version > 0
+ AND r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
+ ORDER BY r.rev_id DESC
+ LIMIT 2;");
+ $result_choose_diff2 = mysql_fetch_array($query_choose_diff_ar);
+ $result_choose_diff1 = mysql_fetch_array($query_choose_diff_ar);
+ //echo "<p>".$result_choose_diff1['rev_id']." vs.
".$result_choose_diff2['rev_id']."</p>";
+ }
+ else {
+ $query_choose_diff = mysql_query("SELECT r.rev_id
+ FROM data_ d, data_revision r
+ WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
+ AND d.data_id = r.data_id
+ AND r.rev_version > 0
+ AND r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
+ ORDER BY r.rev_id DESC
+ LIMIT 1;");
+ $result_choose_diff2 = mysql_fetch_array($query_choose_diff);
+
+ $query_choose_diff_ar = mysql_query("SELECT r.rev_id
+ FROM data_a d, data_revision_a r
+ WHERE d.data_name =
'".mysql_real_escape_string($tmp_d_name)."'
+ AND d.data_id = r.data_id
+ AND r.rev_version > 0
+ AND r.rev_language =
'".mysql_real_escape_string($roscms_standard_language)."'
+ ORDER BY r.rev_id DESC
+ LIMIT 1;");
+ $result_choose_diff1 = mysql_fetch_array($query_choose_diff_ar);
+ }
$t_diff1 = $result_choose_diff1['rev_id'];
$t_diff2 = $result_choose_diff2['rev_id'];
+
+
+ if ($RosCMS_GET_d_arch) {
+ $t_diff1 = "ar".$t_diff1;
+ $t_diff2 = "ar".$t_diff2;
+ }
+ else {
+ $t_diff1 = "ar".$t_diff1;
+ }
+
?>
- <span id="bshowdiff" class="frmeditbutton"
onclick="diffentries3(<?php echo $t_diff1 .",". $t_diff2;
?>)"><img id="bshowdiffi" src="images/tab_closed.gif"
alt="" style="width:11px; height:11px; border:0px;"
/> Compare</span>
+ <span id="bshowdiff" class="frmeditbutton"
onclick="diffentries3('<?php echo $t_diff1 ."','". $t_diff2;
?>')"><img id="bshowdiffi"
src="images/tab_closed.gif" alt="" style="width:11px;
height:11px; border:0px;" /> Compare</span>
<?php
}
- }
+ /*}
else {
?>
<span id="bshowdiff" class="frmeditbutton"
onclick="diffentries3(<?php echo $RosCMS_GET_d_r_id .",".
$RosCMS_GET_d_r_id; ?>)"><img id="bshowdiffi"
src="images/tab_closed.gif" alt="" style="width:11px;
height:11px; border:0px;" /> Compare</span> (select two different
entries)
<?php
- }
+ } */
?>
<span id="mefasi"> </div>
</div></div>
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export.php Mon Aug 27 18:35:02 2007
@@ -122,6 +122,14 @@
default:
case "show":
+ if (strpos($RosCMS_GET_d_r_id, "tr") === false) {
+ // normal (contains NO "tr")
+ }
+ else {
+ // translation mode (contains "tr")
+ $RosCMS_GET_d_value2 = $RosCMS_GET_d_r_lang;
+ }
+
$RosCMS_GET_d_value = str_replace("tr", "",
$RosCMS_GET_d_value); // remove "tr" so that it also work in translation view
if ( is_numeric($RosCMS_GET_d_value) ) {
@@ -146,10 +154,14 @@
if ($RosCMS_GET_d_value3 == "") {
//echo "<p>!!!</p>";
$tmp_nbr = get_tag($result_show_revision['data_id'],
$result_show_revision['rev_id'], "number");
+ //echo "<p>tmp_nbr: ".$tmp_nbr."</p>";
+ }
+ else {
+ $tmp_nbr = $RosCMS_GET_d_value3;
}
//echo "<h1>preview</h1>\n";
//echo "<p>generate_page(".$RosCMS_GET_d_value.",
".$RosCMS_GET_d_value2.", ".$RosCMS_GET_d_value3.",
".$RosCMS_GET_d_use.")</p>";
- log_event_generate_low("preview page:
generate_page(".$RosCMS_GET_d_value.", ".$RosCMS_GET_d_value2.",
".$RosCMS_GET_d_value3.", ".$RosCMS_GET_d_use.")");
+ log_event_generate_low("preview page: generate_page(".$tmp_name.",
".$tmp_lang.", ".$tmp_nbr.", ".$RosCMS_GET_d_use.")");
echo generate_page($tmp_name, $tmp_lang, $tmp_nbr, $RosCMS_GET_d_use);
//echo generate_page("sitemap", "en", "",
"show");
break;
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export_page.php Mon Aug 27 18:35:02 2007
@@ -280,7 +280,7 @@
$fp = fopen($RosCMS_current_page_out_file, "w");
flock($fp,2);
fputs($fp,$RosCMS_current_page_content); // write content
- fputs($fp,"\n\n<!-- Generated with ".$roscms_extern_brand."
".$roscms_extern_version." (".$roscms_extern_version_detail.")
[#RosCMS_v3] -->");
+ fputs($fp,"\n\n<!-- Generated with ".$roscms_extern_brand."
".$roscms_extern_version." (".$roscms_extern_version_detail.") -
".date("Y-m-d H:i:s")." [#RosCMS_v3] -->");
flock($fp,3);
fclose($fp);
@@ -295,10 +295,14 @@
function generate_page($g_page_name, $g_page_lang, $g_page_dynida, $g_output_type) {
+ //echo "generate_page(".$g_page_name.", ".$g_page_lang.",
".$g_page_dynida.", ".$g_output_type.")";
+
+
global $roscms_intern_account_id;
global $roscms_intern_webserver_pages;
global $roscms_standard_language;
global $roscms_intern_webserver_roscms;
+ global $roscms_standard_language_full;
global $g_lang;
global $g_cur_page_name;
@@ -308,6 +312,7 @@
$g_page_dynid = $g_page_dynida;
$g_linkstyle = $g_output_type;
+ //echo "<p>g_page_dynid: ".$g_page_dynid."</p>";
set_time_limit(0); // unlimited script run time
@@ -421,6 +426,14 @@
// current page edit link:
$g_content = str_replace("[#roscms_page_edit]",
$roscms_intern_webserver_roscms."?page=data_out&d_f=page&d_u=show&d_val=".$g_page_name."&d_val2=".$g_lang."&d_val3=".$g_page_dynid."&d_val4=edit",
$g_content);
+
+ // translation info:
+ if ($g_lang == $roscms_standard_language) {
+ $g_content = str_replace("[#roscms_trans]", "<p><a
href=\"".$roscms_intern_webserver_roscms."?page=data_out&d_f=page&d_u=show&d_val=".$g_page_name."&d_val2=".$g_lang."&d_val3=".$g_page_dynid."&d_val4=edit"."\"
style=\"font-size:10px !important;\">Edit page content</a> (RosCMS
translator account membership required, visit the <a
href=\"".$roscms_intern_webserver_pages."forum/\"
style=\"font-size:10px !important;\">website forum</a> for
help)</i></p><br />", $g_content);
+ }
+ else {
+ $g_content = str_replace("[#roscms_trans]", "<p><i>If the
translation of the <a
href=\"".$roscms_intern_webserver_pages."?page=".$g_page_name."&lang=".$roscms_standard_language."\"
style=\"font-size:10px
!important;\">".$roscms_standard_language_full." language</a> of
this page appears to be outdated or incorrect, please check-out the <a
href=\"".$roscms_intern_webserver_pages."?page=".$g_page_name."&lang=".$roscms_standard_language."\"
style=\"font-size:10px
!important;\">".$roscms_standard_language_full."</a> page and
<a
href=\"http://www.reactos.org/forum/viewforum.php?f=18\"
style=\"font-size:10px !important;\">report</a> or <a
href=\"".$roscms_intern_webserver_roscms."?page=data_out&d_f=page&d_u=show&d_val=".$g_page_name."&d_val2=".$g_lang."&d_val3=".$g_page_dynid."&d_val4=edit"."\"
style=\"font-size:10px !important;\">update the
content</a>.</i></p><br />", $g_content);
+ }
// $g_log .= "<hr />";
@@ -503,6 +516,7 @@
}
}
+ $RosCMS_result_content_temp = "";
// preview-edit-mode
if ($RosCMS_GET_d_value4 == "edit" &&
$result_content['data_acl'] == "default" && $g_insert_match_type
!= "script") {
$RosCMS_result_content_temp = "<div style=\"border: 1px dashed
red;\"><div style=\"padding: 2px;\"><a
href=\"".$roscms_intern_page_link."data&branch=".$RosCMS_GET_branch."&edit=rv".$result_content['data_id']."|".$result_content['rev_id']."\"
style=\"background-color:#E8E8E8;\"> <img
src=\"".$roscms_intern_webserver_roscms."images/edit.gif\"
style=\"width:19px; height:19px; border:none;\"
/><i>".$g_match_name."</i> </a></div>";
@@ -517,6 +531,7 @@
// echo "<h3>!!".get_tag($result_content['data_id'],
$result_content['rev_id'], "kind")."!! <=>
get_tag(".$result_content['data_id'].",
".$result_content['rev_id'].", \"kind\")</h3>";
if (get_tag($result_content['data_id'], $result_content['rev_id'],
"kind") == "php") {
$RosCMS_result_content_temp = eval_template($RosCMS_result_content_temp,
$g_page_dynid, $g_match_lang);
+ //echo "<p>REV_ID:
".$result_content['rev_id']."</p>";
}
}
// echo "<p>".$g_match_name." -
|".$g_insert_match_type."|</p>";
@@ -606,6 +621,8 @@
function eval_template($code, $dyncontid, $dyncontlang) { // function code idea from:
http://www.zend.com/zend/art/buffering.php
+ //echo "<p>eval_template(code, ".$dyncontid.",
".$dyncontlang.")</p>";
+
ob_start();
$roscms_template_var_pageid = "";
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php Mon Aug 27 18:35:02 2007
@@ -175,7 +175,7 @@
case "nbr": // number ("dynamic" entry)
$roscms_d_tags_counter++;
$roscms_mtbl_order .= " v".$roscms_d_tags_counter.".tv_value
".$roscms_d_f2_typeb.", ";
- $roscms_mtbl_order_where .= " AND
n".$roscms_d_tags_counter.".tn_name = 'number' ";
+ $roscms_mtbl_order_where .= " AND
n".$roscms_d_tags_counter.".tn_name = 'number_sort' ";
break;
case "type": // type
$roscms_mtbl_order .= "d.data_type ".$roscms_d_f2_typeb.",
";
@@ -624,8 +624,11 @@
$temp_status = "";
$temp_status2 = "";
+
$temp_status2 = getTagValue($result_xml_ptm['data_id'],
$result_xml_ptm['rev_id'], '-1', 'status');
-
+ $temp_dynamic = getTagValue($result_xml_ptm['data_id'],
$result_xml_ptm['rev_id'], '-1', 'number');
+
+
if ($roscms_mtbl_translate == "") {
if ($temp_status2 == "stable") {
if ($temp_counter%2) {
@@ -658,12 +661,27 @@
$tblentry_d_r_usrid = $result_xml_ptm['rev_usrid'];
}
else { // translation
+ if ($temp_dynamic != "") {
+ $tmp_trans_sql_1 = " , data_tag".$RosCMS_d_a." a,
data_tag_name".$RosCMS_d_a." n, data_tag_value".$RosCMS_d_a." v
";
+ $tmp_trans_sql_2 = " AND r.data_id = a.data_id
+ AND r.rev_id = a.data_rev_id
+ AND (a.tag_usrid = '-1')
+ AND a.tag_name_id = n.tn_id
+ AND a.tag_value_id = v.tv_id
+ AND v.tv_value =
'".mysql_real_escape_string($temp_dynamic)."' ";
+ }
+ else {
+ $tmp_trans_sql_1 = "";
+ $tmp_trans_sql_2 = "";
+ }
+
$query_xml_ptm_trans = mysql_query("SELECT d.data_id, d.data_name, d.data_type,
r.rev_id, r.rev_version, r.rev_language, r.rev_datetime, r.rev_date, r.rev_usrid
- FROM data_revision".$RosCMS_d_a." r,
data_".$RosCMS_d_a2." d
+ FROM data_".$RosCMS_d_a2." d,
data_revision".$RosCMS_d_a." r ". $tmp_trans_sql_1 ."
WHERE d.data_id =
'".mysql_real_escape_string($result_xml_ptm['data_id'])."'
AND r.rev_version > 0
AND d.data_id = r.data_id
AND r.rev_language =
'".mysql_real_escape_string($roscms_mtbl_translate)."'
+ ". $tmp_trans_sql_2 ."
LIMIT 1;");
$result_xml_ptm_trans = mysql_fetch_array($query_xml_ptm_trans);
@@ -716,7 +734,6 @@
}
}
- $temp_dynamic = getTagValue($result_xml_ptm['data_id'],
$result_xml_ptm['rev_id'], '-1', 'number');
if ($result_xml_ptm['data_type'] == "content" &&
$temp_dynamic != "") {
$tblentry_d_name .= "_".$temp_dynamic;
}
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php Mon Aug 27 18:35:02 2007
@@ -56,7 +56,7 @@
var roscms_archive = 0;
- var autosave_coundown = 100000; // 10000
+ var autosave_coundown = 100000; // 10000; 100000
var submenu_button = '';
@@ -1362,7 +1362,7 @@
load_frametable('script');
break;
case '7':
- filtstring2 = 'y_is_content_0|k_is_stable_0<?php if ($roscms_security_level
== 1) { echo "|i_is_default_0"; } ?>|c_is_user_0|l_is_<?php echo
$roscms_standard_language; ?>_0|r_is_'+translang+'|o_asc_name';
+ filtstring2 =
'y_is_content_0|k_is_stable_0|i_is_default_0|c_is_user_0|l_is_<?php echo
$roscms_standard_language; ?>_0|r_is_'+translang+'|o_asc_name';
load_frametable('translate');
break;
case '8':
@@ -2597,8 +2597,8 @@
}
catch (e) {
rtestop(); // destroy old rich text editor instances
- window.clearTimeout(autosave_timer);
- autosave_cache = '';
+ //window.clearTimeout(autosave_timer);
+ //autosave_cache = '';
//alert('autosave bug stopped');
}
}
@@ -2614,7 +2614,7 @@
load_frametable_cp2(roscms_current_tbl_position);
window.clearTimeout(autosave_timer);
- autosave_cache = '';
+ //autosave_cache = '';
alertbox('Draft saved');
}
@@ -2653,32 +2653,34 @@
load_frametable_cp2(roscms_current_tbl_position);
window.clearTimeout(autosave_timer);
- autosave_cache = '';
+ //autosave_cache = '';
alertbox('Entry saved');
}
function autosave_try(t_d_id, t_d_revid) {
+ //alert('autosave-try');
window.clearTimeout(autosave_timer);
- autosave_cache = '';
+ //autosave_cache = '';
try {
if (document.getElementById("editautosavemode").value ==
'false') {
window.clearTimeout(autosave_timer);
- autosave_cache = '';
+ //autosave_cache = '';
//alert('autosave-end');
return;
}
}
catch (e) {
window.clearTimeout(autosave_timer);
- autosave_cache = '';
+ //autosave_cache = '';
+ //alert('autosave-end2');
return;
}
if (autosave_cache != prepair_edit_form_submit() && autosave_cache !=
'') {
-// alert('auto-save: (txtbox - cache)\n'+prepair_edit_form_submit()
+'\n'+ autosave_cache);
+ //alert('auto-save: (txtbox - cache)\n'+prepair_edit_form_submit()
+'\n'+ autosave_cache);
-// alert('!!!autosave_try: '+t_d_id+' vs.
'+document.getElementById("entrydataid").className+' |
'+t_d_revid+' vs.
'+document.getElementById("entrydatarevid").className);
+ //alert('!!!autosave_try: '+t_d_id+' vs.
'+document.getElementById("entrydataid").className+' |
'+t_d_revid+' vs.
'+document.getElementById("entrydatarevid").className);
edit_form_submit_draft_autosave(document.getElementById("entrydataid").className,
document.getElementById("entrydatarevid").className);
}
@@ -3366,7 +3368,11 @@
}
?>
load_frametable_cp(0);
- alertbox('Page generation process finished');
+ <?php
+ if (!$RosCMS_GET_debug) {
+ echo " alertbox('Page generation process finished'); ";
+ }
+ ?>
break;
case 'editalterfields':
//alert('!!! saved?: '+http_request.responseText);
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php Mon Aug 27 18:35:02 2007
@@ -25,6 +25,8 @@
function roscms_subsys_login($subsys, $login_type, $target)
{
+ global $roscms_intern_webserver_roscms;
+
if (ROSCMS_LOGIN_OPTIONAL != $login_type &&
ROSCMS_LOGIN_REQUIRED != $login_type)
{
@@ -100,12 +102,9 @@
$userid = $row[0];
// For the Wiki, we have to start a session
- if( $subsys == "wiki" )
- {
- define('MEDIAWIKI', '');
- require_once("../wiki/includes/GlobalFunctions.php");
- wfSetupSession();
- }
+ define('MEDIAWIKI', '');
+ require_once("../wiki/includes/GlobalFunctions.php");
+ wfSetupSession();
if (isset($row[1]))
{
@@ -132,7 +131,7 @@
if (0 == $userid && ROSCMS_LOGIN_REQUIRED == $login_type)
{
- $url = "/roscms/?page=login";
+ $url = $roscms_intern_webserver_roscms."?page=login";
if ("" != $target)
{
$url .= "&target=" . urlencode($target);
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/user_login.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/user_login.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/user_login.php Mon Aug 27 18:35:02 2007
@@ -339,7 +339,7 @@
if ($roscms_currentuser_login_user_lastsession_counter > 0) {
create_login_page("Your account settings only allow you to login
once.<br>\n" .
"You are already logged in so you cannot login again.
<br>\n".
- "For more informations please have a look at the <a
href=\"http://www.reactos.org/xhtml/de/about_userfaq.html#multilogin\&…)>FAQ</a>");
+ "For more informations please have a look at the <a
href=\"http://www.reactos.org/?page=about_userfaq#multilogin\">…)>FAQ</a>");
exit;
}
}
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/usergroups.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/usergroups.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/usergroups.php Mon Aug 27 18:35:02 2007
@@ -110,7 +110,7 @@
WHERE data_id = ".mysql_real_escape_string($d_id)."
AND y.sec_name = d.data_acl
AND y.sec_branch =
'".mysql_real_escape_string($roscms_branch)."'
- LIMIT 1;");
+ LIMIT 1;") or die("Data-Entry \"".$d_id."\"not
found [usergroups].");
$result_data_sec_rights = mysql_fetch_array($query_data_sec_rights);
$tmp_acl_allow = false;