function alert($values) { ?> <script language="javascript"> alert("<?php echo jsAddSlashes($values); ?> "); </script> <?php }
function encrypt($str) { global $encryption_key; $str = str_replace(' ', '-', $str); $encryption_key = str_replace(chr(32), '', $encryption_key); if (strlen($encryption_key) < 8) { exit(jsAddSlashes('<b>HashOver - Error:</b> Key error, make sure it\'s at least 8 characters long.', 'single')); } $kl = strlen($encryption_key) < 32 ? strlen($encryption_key) : 32; $k = array(); for ($i2 = 0; $i2 < $kl; $i2++) { $k[$i2] = ord($encryption_key[$i2]) & 0x1f; } $j = 0; for ($i2 = 0; $i2 < strlen($str); $i2++) { $e = ord($str[$i2]); $str[$i2] = $e & 0xe0 ? chr($e ^ $k[$j]) : chr($e); $j++; $j = $j == $kl ? 0 : $j; } return $str; }
$parse_url = parse_url($page_url); // Turn page URL into array $ref_queries = isset($parse_url['query']) ? explode('&', $parse_url['query']) : array(); //this is needed for other scripts //using page, so it is compatible with WonderCMS if (isset($parse_url['query'])) { parse_str($parse_url['query'], $ref_parsed); if (isset($ref_parsed['page'])) { $ref_path = $ref_parsed['page']; } } if (!isset($ref_path)) { $ref_path = $parse_url['path'] == '/' ? 'home' : str_replace(array('/', '.', '='), '-', substr($parse_url['path'], 1)); } //remove hashover_reply and hashover_edit $ignore_queries = array('hashover_reply', 'hashover_edit'); $parse_url['query'] = ''; for ($q = 0; $q <= count($ref_queries) - 1; $q++) { if (!in_array($ref_queries[$q], $ignore_queries) and !empty($ref_queries[$q])) { $ref_parts = explode('=', $ref_queries[$q]); if (!in_array(basename($ref_queries[$q], '=' . end($ref_parts)), $ignore_queries)) { $parse_url['query'] .= ($q > 0 and !empty($parse_url['query'])) ? '&' . $ref_queries[$q] : $ref_queries[$q]; } } } // Page comments directory if ($ref_path != 'hashover-php') { $dir = 'comments/' . $ref_path; } else { exit(jsAddSlashes('<b>HashOver - Error:</b> Failure setting comment directory name')); }
$(document).ready(function(){ <?php foreach ($mFIELDS as $v) { ?> $("#<?php echo $v; ?> ").val("<?php echo jsAddSlashes($ra[0][$v]); ?> "); $("#<?php echo $v; ?> _span").html("<?php echo jsAddSlashes($ra[0][$v]); ?> "); <?php } ?> //datetime $("#create_datetime").datetimepicker({ timepicker:true, format:'Y-m-d H:i:s' }); $("#upload_datetime").datetimepicker({ timepicker:true, format:'Y-m-d H:i:s' });
} else { exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">Post Comment</a>', 'single')); } } } // Clear message cookie if (isset($_COOKIE['message']) and !empty($_COOKIE['message'])) { setcookie('message', '', 1, '/', str_replace('www.', '', $domain)); } // Check if either a comment or reply failed to post if (isset($_COOKIE['success']) and $_COOKIE['success'] == 'no') { setcookie('success', '', 1, '/', str_replace('www.', '', $domain)); if (isset($_COOKIE['replied']) and !empty($_COOKIE['replied'])) { $text['comment_form'] = $text['reply_form']; $text['post_button'] = $text['post_reply']; setcookie('replied', '', 1, '/', str_replace('www.', '', $domain)); } } // Check if visitor is on mobile device if (preg_match('/android/i', $_SERVER['HTTP_USER_AGENT']) or preg_match('/blackberry/i', $_SERVER['HTTP_USER_AGENT']) or preg_match('/phone/i', $_SERVER['HTTP_USER_AGENT'])) { $is_mobile = 'yes'; } else { $is_mobile = 'no'; } read_comments($dir, 'yes'); // Run read_comments function krsort($top_likes); // Sort popular comments if (!(include './scripts/php-mode.php')) { exit(jsAddSlashes('<b>HashOver - Error:</b> file "php-mode.php" could not be included!', 'single')); }
echo jsAddSlashes('<option value="bylikes">' . $text['sort_bylikes'] . '</option>\\n'); echo jsAddSlashes('</select>\\n</span>\\n') . PHP_EOL; echo jsAddSlashes('<div id="sort_div">\\n') . PHP_EOL; echo 'for (var comment in comments) {' . PHP_EOL; echo "\t" . 'parse_template(comments[comment], false);' . PHP_EOL; echo '}' . PHP_EOL . PHP_EOL; echo jsAddSlashes('</div>\\n') . PHP_EOL; } else { echo jsAddSlashes('<div style="margin: 16px 0px 12px 0px;" class="cmtdiv">\\n'); echo jsAddSlashes('<span class="cmtnumber"><img width="' . $icon_size . '" height="' . $icon_size . '" src="/hashover/images/first-comment.png"></span>\\n'); echo jsAddSlashes('<div style="height: ' . $icon_size . 'px;" class="cmtbubble">\\n'); echo jsAddSlashes('<b class="cmtnote cmtfont" style="color: #000000;">Be the first to comment!</b>\\n</div>'); } echo jsAddSlashes('</div><br>\\n') . PHP_EOL; echo jsAddSlashes('<center>\\n'); echo jsAddSlashes('HashOver Comments ·\\n'); if (!empty($show_cmt)) { echo jsAddSlashes('<a href="http://' . $domain . '/hashover.php?rss=' . $page_url . '" target="_blank">RSS Feed</a> ·\\n'); } echo jsAddSlashes('<a href="http://' . $domain . '/hashover.zip" rel="hashover-source" target="_blank">Source Code</a> ·\\n'); echo jsAddSlashes('<a href="http://' . $domain . '/hashover.php" rel="hashover-javascript" target="_blank">JavaScript</a> ·\\n'); echo jsAddSlashes('<a href="http://tildehash.com/hashover/changelog.txt" target="_blank">ChangeLog</a> ·\\n'); echo jsAddSlashes('<a href="http://tildehash.com/hashover/archives/" target="_blank">Archives</a><br>\\n'); echo jsAddSlashes('</center>\\n'); // Script execution ending time $exec_time = explode(' ', microtime()); $exec_end = $exec_time[1] + $exec_time[0]; $exec_time = $exec_end - $exec_start; echo PHP_EOL . '// Place all content on page' . PHP_EOL; echo 'document.getElementById("hashover").innerHTML = show_cmt;' . PHP_EOL . PHP_EOL; echo '// Script Execution Time: ' . round($exec_time, 5) . ' Seconds';
$("#search_btn").click(function(){ doSearch(0); });*/ window['wh']=getWindowSize(); $(".thepng").unbind("click"); $(".thepng").click(function(){ var tmp = ""; tmp = sprintf("<div style='text-align:center;width:%dpx;height:%dpx;overflow:auto;'><img style='background-color:white;width='%s' src='%s'></div>", (window['wh']['width']*80/100 ), (window['wh']['height']*80/100 ), (window['wh']['width']*50/100 ),$(this).attr('src')); dialogOn(tmp,true,function(){ }); }); $("#searchcode").val("<?php echo jsAddSlashes(urldecode(htmlspecialchars_decode($POSTS['searchcode']))); ?> "); $("#search_btn").unbind("click"); $("#search_btn").click(function(){ $("#theform").submit(); }); $("#search_by_keywords_btn").unbind("click"); $("#search_by_keywords_btn").click(function(){ //語意搜尋 var o = new Object(); o['s']=$("#searchcode").val(); var new_search_code = myAjax("<?php echo $base_url;
echo '];' . PHP_EOL . PHP_EOL; } // Display comments, if there are no comments display a note if (!empty($show_cmt)) { echo jsAddSlashes('<div id="sort_div">\\n') . PHP_EOL; echo 'for (var comment in comments) {' . PHP_EOL; echo "\t" . 'parse_template(comments[comment], false);' . PHP_EOL; echo '}' . PHP_EOL . PHP_EOL; echo jsAddSlashes('</div>\\n') . PHP_EOL; } else { //echo jsAddSlashes('<div style="margin: 16px 0px 12px 0px;" class="cmtdiv">\n'); //echo jsAddSlashes('<span class="cmtnumber"><img width="' . $icon_size . '" height="' . $icon_size . '" src="/hashover/images/first-comment.png"></span>\n'); //echo jsAddSlashes('<div style="height: ' . $icon_size . 'px;" class="cmtbubble">\n'); //echo jsAddSlashes('<b class="cmtnote cmtfont" style="color: #000000;">Be the first to comment!</b>\n</div>'); } echo jsAddSlashes('</div><br>\\n') . PHP_EOL; // echo jsAddSlashes('<center>\n'); // echo jsAddSlashes('<a href="http://tildehash.com" target="_blank">HashOver Comments</a>\n'); //if (!empty($show_cmt)) echo jsAddSlashes('<a href="http://' . $domain . '/hashover.php?rss=' . $page_url . '" target="_blank">RSS Feed</a> ·\n'); //echo jsAddSlashes('<a href="http://' . $domain . '/hashover.zip" rel="hashover-source" target="_blank">Source Code</a> ·\n'); //echo jsAddSlashes('<a href="http://' . $domain . '/hashover.php" rel="hashover-javascript" target="_blank">JavaScript</a> ·\n'); //echo jsAddSlashes('<a href="http://tildehash.com/hashover/changelog.txt" target="_blank">ChangeLog</a> ·\n'); //echo jsAddSlashes('<a href="http://tildehash.com/hashover/archives/" target="_blank">Archives</a><br>\n'); // echo jsAddSlashes('</center>\n'); // Script execution ending time $exec_time = explode(' ', microtime()); $exec_end = $exec_time[1] + $exec_time[0]; $exec_time = $exec_end - $exec_start; echo PHP_EOL . '// Place all content on page' . PHP_EOL; echo 'document.getElementById("hashover").innerHTML = show_cmt;' . PHP_EOL . PHP_EOL; echo '// Script Execution Time: ' . round($exec_time, 5) . ' Seconds';
function requestip(&$p, &$w, $ds, $cust) { // get all request records $sqllastmod = $ds->ds->SQLDate("M d Y H:i:s", 'lastmod'); $result = $ds->ds->Execute("SELECT requestindex, requestdesc, userinf, location, telno, \n descrip, hname, macaddr, {$sqllastmod} AS lastmod, info\n FROM requestip\n WHERE customer={$cust}"); // emulate for databases that do not have RecordCount // not records, do nothing if (!$result->PO_RecordCount("requestip", "customer={$cust}")) { return; } // if a specific network template exists, use that, else use generic template $savtemplate = new IPplanIPTemplate("iptemplate", $cust); $err = $savtemplate->is_error(); $lst = array(); $jsarr = ""; $lst["0"] = "No request"; $cnt = 0; while ($row = $result->FetchRow()) { $template = $savtemplate; // reset template - additional fields could have been added $col = $row["requestindex"]; $lst["{$col}"] = $row["requestdesc"]; $jsarr .= " dbf[{$col}]=new Array();\n"; $jsarr .= " dbf[{$col}][1]=\"" . jsAddSlashes($row["userinf"]) . "\";\n"; $jsarr .= " dbf[{$col}][2]=\"" . jsAddSlashes($row["location"]) . "\";\n"; $jsarr .= " dbf[{$col}][3]=\"" . jsAddSlashes($row["descrip"]) . "\";\n"; $jsarr .= " dbf[{$col}][4]=\"" . jsAddSlashes($row["hname"]) . "\";\n"; $jsarr .= " dbf[{$col}][5]=\"" . jsAddSlashes($row["telno"]) . "\";\n"; $jsarr .= " dbf[{$col}][6]=\"" . jsAddSlashes(substr(chunk_split($row["macaddr"], 2, ':'), 0, -1)) . "\";\n"; // no template error if (!$err) { $template->Update($template->decode($row["info"])); $cnt2 = ADD_INFO; $jsset = ""; foreach ($template->userfld as $arr) { $jsarr .= " dbf[{$col}][{$cnt2}]=\"" . jsAddSlashes(preg_replace('/(\\r\\n)|\\n|\\r/m', '\\n', isset($arr["value"]) ? $arr["value"] : "")) . "\";\n"; $jsset .= " parent.document.MODIFY.elements[{$cnt2}].value=dbf[idx][{$cnt2}];\n"; $cnt2++; } } $cnt++; } insert($p, script(' function modifyipform() { dbf=new Array(); ' . $jsarr . ' idx=document.REQUESTIP.request.value; document.MODIFY.request.value=idx; if ((idx) == 0) return; document.MODIFY.user.value=dbf[idx][1]; document.MODIFY.location.value=dbf[idx][2]; document.MODIFY.descrip.value=dbf[idx][3]; document.MODIFY.hname.value=dbf[idx][4]; document.MODIFY.telno.value=dbf[idx][5]; document.MODIFY.macaddr.value=dbf[idx][6]; ' . $jsset . ' } ', array("language" => "JavaScript", "type" => "text/javascript"))); insert($w, $f = form(array("name" => "REQUESTIP", "method" => "get", "action" => $_SERVER["PHP_SELF"]))); insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Requested addresses"))); insert($con, selectbox($lst, array("name" => "request", "onChange" => "modifyipform()"))); }