Ejemplo n.º 1
0
        }
        echo "<SCRIPT LANGUAGE=\"JavaScript\">\n\t\tparent.document.getElementById('{$iframeID}').innerHTML='{$show}';\n\t\t</SCRIPT>";
    } else {
        //JS式会拖慢主页面打开速度,不推荐
        echo "document.write('{$show}');";
    }
    exit;
} elseif ($type == 'sonfid') {
    $fid && ($rs = $db->get_one("SELECT fup FROM {$pre}spsort WHERE fid='{$fid}'"));
    $show = get_fidName($rs[fup], $rows, $class ? $class : 3);
    if (!$show) {
        $show = "暂无...";
    }
    //真静态
    if ($webdb[NewsMakeHtml] == 1 || $gethtmlurl) {
        $show = make_html($show, $pagetype = 'N');
    } elseif ($webdb[NewsMakeHtml] == 2) {
        $show = fake_html($show);
    }
    if ($webdb[RewriteUrl] == 1) {
        //全站伪静态
        rewrite_url($show);
    }
    $show = "<ul>{$show}</ul>";
    $show = str_Replace("'", '"', $show);
    $show = str_Replace("\r", '', $show);
    $show = str_Replace("\n", '', $show);
    $show = "document.write('{$show}');";
    echo $show;
} else {
    die("document.write('指定的类型不存在');");
Ejemplo n.º 2
0
    <div class="page-header" style="margin-top: -15px;">
        <h3><i class="fa fa-tachometer"></i> <?php 
echo lang('DASHBOARD_TITLE');
?>
</h3>
    </div>
    
    
    <div class="row">
<div class="col-md-12">
		<div class="col-md-6">

            <div class="alert alert-info alert-dismissable">

                <?php 
echo make_html(get_myname() . get_dashboard_msg());
?>

            </div>

        </div>
		<div class="col-md-6">
            <div class="panel panel-default">
                <div class="panel-heading"><a href="stats"><i class="fa fa-bar-chart-o"></i> <?php 
echo lang('DASHBOARD_ticket_stats');
?>
</a></div>
                <div class="panel-body">
                    <div class="row">

                        <div class="col-md-4 col-xs-4"><center>    <strong class="text-danger"  style="font-weight: bold; font-style: normal; font-variant: normal; font-size: 20px;" data-toggle="tooltip" data-placement="top" title="<?php 
Ejemplo n.º 3
0
function validate_input($valid, &$p, &$error)
{
    $error = null;
    if ($valid['type'] != 'func') {
        if (is_array($p)) {
            $val =& $p[$valid['_input']];
        } else {
            $val =& $p;
        }
    }
    switch ($valid['type']) {
        case 'address':
            $val = string_check($val);
            if (empty($valid['blank']) and strlen($val) < 4) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid address.';
            }
            if (!empty($valid['lines']) and !empty($val) and substr_count($val, "\n") < $valid['lines'] - 1) {
                $error = 'This address must contain at least ' . $valid['lines'] . ' lines.';
            }
            if (!empty($valid['format'])) {
                $val = str_replace(array("\r", "\n", "\r\n", ', '), ',', $val);
            }
            break;
        case 'array':
        case 'choice':
        case 'select':
            // $val can't be an array at this point as that's sorted higher up by validate_input_array()
            if (!is_array($valid['options']) and function_exists($valid['options'])) {
                $valid['options'] = $valid['options']();
            }
            if (is_array($valid['options'])) {
                if (is_assoc($valid['options'])) {
                    $err = !@isset($valid['options'][$val]);
                } else {
                    $err = !in_array($val, $valid['options']);
                }
            } elseif (isset($valid['no-opts'])) {
                $val = '';
            } else {
                $err = true;
                $valid['msg'] = 'The options could not be found for this field.';
            }
            if (isset($valid['not-empty']) and empty($val)) {
                $err = true;
            }
            if (!empty($err)) {
                if (!empty($valid['blank'])) {
                    $val = '';
                } elseif (!empty($valid['msg'])) {
                    $error = $valid['msg'];
                } else {
                    $error = 'You must select one of the available options.';
                }
            }
            break;
        case 'bool':
        case 'boolean':
            if (!empty($val)) {
                $val = !empty($valid['set']) ? $valid['set'] : 1;
            } elseif (!empty($valid['mandatory'])) {
                $error = 'You must tick this box to continue.';
            } else {
                $val = !empty($valid['empty']) ? $valid['empty'] : 0;
            }
            break;
        case 'clear':
            $val = false;
            break;
            // we can't do this because of the isset check in valid; use the func method to point to valid_copy instead
            // case 'copy':
            // $val=$p[$valid['copy']];
            // break;
        // we can't do this because of the isset check in valid; use the func method to point to valid_copy instead
        // case 'copy':
        // $val=$p[$valid['copy']];
        // break;
        case 'currency':
            if (!make_currency($val, $valid['blank'] ? 1 : false)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid currency value';
            }
            if (!empty($valid['positive']) and $val < 0) {
                $val *= -1;
            }
            break;
        case 'dat':
        case 'date':
            // we had to be careful here, as when we moved to a function with &$error
            // it started adding the error even if we planned to ignore it
            // use $err in these cases but might be better to pass on the blank flag
            // to sub functions of the validator
            $func = 'sql_' . $valid['type'];
            $val = $func($val, $err);
            $today_date = date('Y-m-d');
            if (empty($val)) {
                if (!empty($valid['blank'])) {
                    $val = $valid['blank'] == 'today' ? $today_date : '';
                } else {
                    $error = !empty($err) ? $err : 'The date you entered was not recognised';
                }
            } else {
                if (!empty($valid['past'])) {
                    $valid['max'] = $today_date;
                }
                if (!empty($valid['future'])) {
                    $valid['min'] = $today_date;
                }
                if (!empty($valid['max']) and $val > $valid['max']) {
                    $error = 'The date specified is greater than the maximum allowed.';
                }
                if (!empty($valid['min']) and $val < $valid['min']) {
                    $error = 'The date specified is less than the minimum allowed.';
                }
            }
            break;
        case 'dob':
            if (!empty($val)) {
                $val = date_from_dob($val);
            }
            if (empty($val) and empty($valid['blank'])) {
                if (!empty($valid['msg'])) {
                    $error = $valid['msg'];
                } else {
                    $error = 'You must enter a valid date of birth, try ' . (defined(DATE_USA) ? 'mm/dd/yy' : 'dd/mm/yy') . '.';
                }
            }
            if (isset($valid['max']) or isset($valid['min'])) {
                $age = age_from_dob($val);
                if (!empty($valid['max']) and $age > $valid['max']) {
                    $error = 'This date of birth indicates an age of ' . $age . '. It is required that the age is ' . $valid['max'] . ' or less.';
                }
                if (!empty($valid['min']) and $age < $valid['min']) {
                    $error = 'This date of birth indicates an age of ' . $age . '. It is required that the age is ' . $valid['min'] . ' or more.';
                }
            }
            if ($val > date('Y-m-d')) {
                $error = 'A date of birth may not be in the future. If time travel has been invented, please let us know last year.';
            }
            break;
        case 'email':
            if (!make_email($val, $valid['blank'] ? 1 : false)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid email address.';
            }
            break;
        case 'equal':
            if (!string_compare($val, $valid['equal'])) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter the exact value.';
            }
            break;
            // this isn't really a data type, could be removed now that we can accept arrays
        // this isn't really a data type, could be removed now that we can accept arrays
        case 'extra':
            $extra = array();
            if (is_array($val['key'])) {
                foreach ($val['key'] as $n => $key) {
                    $extra[string_check($key)] = string_check($val['val'][$n]);
                }
            }
            $val = serialize($extra);
            break;
        case 'html':
            $val = make_html($val, $valid['tags'], !empty($valid['multi_byte']) ? true : false);
            if ($valid['length'] > 0) {
                if (strlen($val) < $valid['length']) {
                    $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a value at least ' . ($valid['length'] == 1 ? '1 character' : $valid['length'] . ' characters.') . ' long';
                }
            }
            break;
        case 'image':
            break;
        case 'keygen':
            if (empty($val) and empty($valid['regen'])) {
                $val = rand_pass();
            }
            break;
        case 'name':
            $val = make_name($val);
            if (empty($valid['blank']) and empty($val)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid name.';
            }
            break;
        case 'num':
        case 'number':
            if (!is_number($val, $valid['blank'] ? 1 : false)) {
                if (!empty($valid['default'])) {
                    $val = $valid['default'];
                } else {
                    $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid number.';
                }
            }
            if (!empty($val)) {
                // for legacy support
                if (isset($valid['ulimit'])) {
                    $valid['max'] = $valid['ulimit'];
                }
                if (isset($valid['dlimit'])) {
                    $valid['min'] = $valid['dlimit'];
                }
                //
                if (isset($valid['max']) and $val > $valid['max']) {
                    $error = 'You must enter a number no greater than ' . $valid['max'] . '.';
                }
                if (isset($valid['min']) and $val < $valid['min']) {
                    $error = 'You must enter a number no lower than ' . $valid['min'] . '.';
                }
                if (isset($valid['max-other']) and $val > $p[$valid['max-other']]) {
                    $error = 'You must enter a number no greater than ' . $p[$valid['max-other']] . '.';
                }
            }
            break;
        case 'phone':
            if (isset($valid['other'])) {
                $error = !make_phones($val, $p[$valid['other']]);
            } else {
                $error = !make_phone($val, $valid['blank'] ? 1 : false);
            }
            if (!empty($error)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid phone number.';
            }
            break;
        case 'postcode':
            if (!make_postcode($val, $valid['blank'] ? 1 : false)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid postcode.';
            }
            break;
        case 'time':
            if (!make_time($val, $valid['blank'] ? 1 : false, $valid['format'] ? $valid['format'] : null)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid time.';
            }
            break;
        case 'url':
        case 'website':
            if (!make_website($val, $valid['blank'] ? 1 : false)) {
                $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a valid website address.';
            }
            if (is_array($valid['unique'])) {
                $check = query("SELECT " . $valid['unique']['id'] . " FROM " . $valid['unique']['table'] . " WHERE website='{$val}'", 'single');
                if ($check > 0) {
                    $error = 'The website address you entered is already registered.';
                }
            }
            break;
        case 'func':
            $func = $valid['func'];
            if (function_exists($func)) {
                if (!$func($p, $err, $valid)) {
                    $error = !empty($valid['msg']) ? $valid['msg'] : $err;
                }
                break;
            }
        default:
            if (!empty($val)) {
                $val = string_check($val, $valid['strip']);
            }
            if (!empty($valid['length'])) {
                if (strlen($val) < $valid['length']) {
                    $error = !empty($valid['msg']) ? $valid['msg'] : 'You must enter a value at least ' . ($valid['length'] == 1 ? '1 character' : $valid['length'] . ' characters.') . ' long';
                }
            } elseif (!empty($valid['default']) and empty($val)) {
                $val = $valid['default'];
            }
            if (!empty($valid['max']) and $strlen > $valid['max']) {
                $error = 'You may not enter a value longer than ' . $valid['max'] . ' characters.';
            }
    }
    validate_unique($valid, $val, $error);
    if ($error) {
        return false;
    }
    return true;
}
Ejemplo n.º 4
0
                        $to_text = "<div class=''>" . nameshort(name_of_user_ret($row['user_to_id'])) . "</div>";
                    }
                    if ($row['user_to_id'] == 0) {
                        $to_text = "<strong data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . view_array(get_unit_name_return($row['unit_id'])) . "\">" . lang('t_list_a_all') . "</strong>";
                    }
                    ?>
                    <tr >
                        <td style=" vertical-align: middle; "><small><center><?php 
                    echo $row['id'];
                    ?>
</center></small></td>
                        <td style=" vertical-align: middle; "><small><a href="ticket?<?php 
                    echo $row['hash_name'];
                    ?>
"><?php 
                    cutstr(make_html($row['subj'], 'no'));
                    ?>
</a></small></td>
                        <td style=" vertical-align: middle; "><small><?php 
                    name_of_client($row['client_id']);
                    ?>
</small></td>
                        <td style=" vertical-align: middle; "><small><center><time id="c" datetime="<?php 
                    echo $row['date_create'];
                    ?>
"></time></center></small></td>
                        <td style=" vertical-align: middle; "><small><?php 
                    echo nameshort(name_of_user_ret($row['user_init_id']));
                    ?>
</small></td>
Ejemplo n.º 5
0
	</div>
     </div>
     <div class="row" id="content_notes" style="padding-bottom: 25px;">
<div class="col-md-1">
<a id="go_back" class="btn btn-primary btn-sm"><i class="fa fa-reply"></i> <?php 
            echo lang('HELPER_back');
            ?>
</a>
</div>
<div class="col-md-11" id="">

<div class="panel panel-default">
  <div class="panel-body">
	<h3 style=" margin-top: 0px; "><?php 
            echo make_html($fio['title']);
            ?>
</h3>
	<p><?php 
            echo $fio['message'];
            ?>
</p>
	<hr>
	
	<p class="text-right"><small class="text-muted"><?php 
            echo lang('HELPER_pub');
            ?>
: <?php 
            echo nameshort(name_of_user_ret($fio['user_init_id']));
            ?>
</small><br><small class="text-muted"><?php 
Ejemplo n.º 6
0
//附件真实地址还原
$rsdb[content] = En_TruePath($rsdb[content], 0);
$rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]);
$rsdb[picurl] && ($rsdb[picurl] = tempdir($rsdb[picurl]));
if (!$rsdb[yz]) {
    $showsp = "<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$webdb['www_url']}/do/showsp.php?fid={$fid}&id={$id}'>";
} else {
    $showsp = "";
}
require ROOT_PATH . "inc/head.php";
require html("showsp", $main_tpl);
require ROOT_PATH . "inc/foot.php";
$content = ob_get_contents();
ob_end_clean();
$content = preg_replace("/<!--include(.*?)include-->/is", "\\1", $content);
make_html($showsp ? $showsp : $content, 'showsp');
unset($iddb, $fiddb);
require_once ROOT_PATH . "cache/makeShow1.php";
if ($string = $iddb[++$II]) {
    $ar = explode("-", $string);
    write_file(ROOT_PATH . "cache/makeShow_record.php", "?fid={$ar['0']}&id={$ar['1']}&II={$II}");
    echo '<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />';
    echo "请稍候,正在生成专题内容页静态...<META HTTP-EQUIV=REFRESH CONTENT='0;URL=?fid={$ar['0']}&id={$ar['1']}&II={$II}'>";
    exit;
} else {
    unlink(ROOT_PATH . "cache/makeShow1.php");
    unlink(ROOT_PATH . "cache/makeShow_record.php");
    if (count($iddb) == 1) {
        $detail = get_SPhtml_url($fidDB, $id, $rsdb[posttime]);
        header("location:{$detail['showurl']}");
        exit;
Ejemplo n.º 7
0
 /**
  * Generates image previews with alternate text, title and lightbox pop-up activation on mouse click.
  * @param string $body Data associated with the gallery.
  * @param string $paramstring A whitespace-separated list of name="value" parameter values.
  */
 private function getImageGalleryHtml($body, $params = array())
 {
     // set gallery parameters
     $this->curparams = clone $this->defparams;
     // parameters set in back-end
     if (is_array($params)) {
         $this->curparams->setArray($params);
     } else {
         $paramstring = htmlspecialchars_decode((string) $params);
         $this->curparams->setString($paramstring);
         // parameters set inline
     }
     if (!isset($body)) {
         // path is set via parameter with compact activation syntax
         $body = $this->curparams->path;
     }
     $engineservices = SIGPlusEngineServices::instance();
     // generate link to an existing gallery
     if ($this->curparams->link !== false) {
         $lightbox = $engineservices->getLightboxEngine($this->curparams->lightbox);
         // get selected lightbox engine if any or use default
         if ($lightbox && ($linkscript = $lightbox->getLinkScript($this->curparams->link, $this->curparams->index)) !== false) {
             return '<a href="javascript:void(' . htmlspecialchars($linkscript) . ')">' . $body . '</a>';
         } else {
             // engine does not support programmatic activation
             return $body;
         }
     }
     // set gallery folders
     $imageref = $body;
     // a relative path to an image folder or an image, or an absolute URL to an image to display
     if ($isremote = is_remote_path($imageref)) {
         $imageurl = $imageref;
         $iswebalbum = (bool) preg_match('"^https?://picasaweb.google.com/data/feed/(?:api|base)/user/([^/?#]+)/albumid/([^/?#]+)"', $imageurl);
         // test for Picasa galleries
         $imagehashbase = $imageurl;
     } else {
         $imageref = trim($imageref, '/');
         // remove leading and trailing backslash
         // verify validity of relative path
         $imagepath = $this->imageservices->getImagePath($imageref);
         if (!file_exists($imagepath)) {
             throw new SIGPlusImageGalleryFolderException($imageref);
         }
         $imagehashbase = $imagepath;
         // base in computing hash for content caching
     }
     // set gallery identifier
     if ($this->curparams->id) {
         // use user-supplied identifier
         $galleryid = $this->curparams->id;
     } else {
         // automatically generate identifier for thumbnail gallery
         $galleryid = 'sigplus_' . md5($imagehashbase);
     }
     $galleryid = $this->getUniqueGalleryId($galleryid);
     // force meaningful settings for single-image view (disable slider and activate flow layout)
     if ($this->curparams->layout != 'hidden' && ($isremote && !$iswebalbum || isset($imagepath) && is_file($imagepath))) {
         $this->curparams->layout = 'flow';
         $this->curparams->rows = false;
         $this->curparams->cols = false;
         $this->curparams->slider = false;
     }
     // substitute proper left or right alignment depending on whether language is LTR or RTL
     $language = JFactory::getLanguage();
     $this->curparams->alignment = str_replace(array('after', 'before'), $language->isRTL() ? array('left', 'right') : array('right', 'left'), $this->curparams->alignment);
     // get selected slider engine if any, or use default
     $slider = $engineservices->getSliderEngine($this->curparams->slider);
     if (!$slider) {
         $this->curparams->progressive = false;
         // progressive loading is not supported unless a slider is enabled
     }
     // *** cannot update $this->curparams, which is used in content caching, beyond this point *** //
     // initialize logging
     if (SIGPLUS_LOGGING) {
         $logging = SIGPlusLogging::instance();
         if ($isremote) {
             $logging->append('Generating gallery "' . $galleryid . '" from URL: <kbd>' . $imageurl . '</kbd>');
         } else {
             $logging->append('Generating gallery "' . $galleryid . '" from file/directory: <kbd>' . $imagepath . '</kbd>');
         }
         $logging->appendblock('Local parameters for "' . $galleryid . '" are:', print_r($this->curparams, true));
     }
     // verify if content is available in cache folder
     if (!SIGPLUS_CONTENT_CACHING || $engineservices->debug || $this->curparams->hasRandom()) {
         $cachekey = false;
         // galleries that involve a random element cannot be cached
     } elseif (($cachekey = $this->imageservices->getCachedContent($imagehashbase, $this->curparams)) !== false) {
         if (SIGPLUS_LOGGING) {
             $logging->append('Retrieving cached content with key <kbd>' . $cachekey . '</kbd>.');
         }
     }
     // generate gallery HTML code or setup script
     if ($cachekey === false) {
         // save default title and description, which might be overridden in labels file, affecting hash key used in caching
         $deftitle = $this->curparams->deftitle;
         $defdescription = $this->curparams->defdescription;
         if ($isremote) {
             // access images remote domain
             if ($iswebalbum) {
                 $htmlorscript = $this->getPicasaImageGallery($imageurl, $galleryid);
             } else {
                 $extension = strtolower(pathinfo(parse_url($imageurl, PHP_URL_PATH), PATHINFO_EXTENSION));
                 switch ($extension) {
                     case 'gif':
                     case 'jpg':
                     case 'jpeg':
                     case 'png':
                         // plug-in syntax {gallery}http://example.com/image.jpg{/gallery}
                         $labels = array(new SIGPlusImageLabel($imageurl, false, false));
                         // artificial single-entry labels file
                         $htmlorscript = $this->getUserDefinedRemoteImageGallery($labels, $galleryid);
                         break;
                     default:
                         // plug-in syntax {gallery}http://example.com{/gallery}
                         throw new SIGPlusNotSupportedException();
                         $labels = $this->imageservices->getLabels($imageurl, $this->curparams->labels, $this->curparams->deftitle, $this->curparams->defdescription);
                         switch ($this->curparams->sortcriterion) {
                             case SIGPLUS_SORT_RANDOMLABELS:
                                 shuffle($labels);
                                 // fall through
                             // fall through
                             case SIGPLUS_SORT_LABELS_OR_FILENAME:
                             case SIGPLUS_SORT_LABELS_OR_MTIME:
                                 $htmlorscript = $this->getUserDefinedRemoteImageGallery($labels, $galleryid);
                         }
                 }
             }
         } else {
             if (is_file($imagepath)) {
                 // syntax {gallery}folder/subfolder/file.jpg{/gallery}
                 $htmlorscript = $this->getUnlabeledImageGallery(dirname($imagepath), array(basename($imagepath)), $galleryid);
             } else {
                 // syntax {gallery}folder/subfolder{/gallery}
                 // fetch image labels
                 switch ($this->curparams->labels) {
                     case 'filename':
                         $labels = $this->imageservices->getLabelsFromFilenames($imagepath);
                         break;
                     default:
                         $labels = $this->imageservices->getLabels($imagepath, $this->curparams->labels, $this->curparams->deftitle, $this->curparams->defdescription);
                 }
                 switch ($this->curparams->sortcriterion) {
                     case SIGPLUS_SORT_LABELS_OR_FILENAME:
                         if (empty($labels)) {
                             // there is no labels file to use
                             $files = $this->imageservices->getListing($imagepath, SIGPLUS_FILENAME, $this->curparams->sortorder, $this->curparams->depth);
                             $htmlorscript = $this->getUnlabeledImageGallery($imagepath, $files, $galleryid);
                         } else {
                             $htmlorscript = $this->getUserDefinedImageGallery($imagepath, $labels, $galleryid);
                         }
                         break;
                     case SIGPLUS_SORT_LABELS_OR_MTIME:
                         if (empty($labels)) {
                             $files = $this->imageservices->getListing($imagepath, SIGPLUS_MTIME, $this->curparams->sortorder, $this->curparams->depth);
                             $htmlorscript = $this->getUnlabeledImageGallery($imagepath, $files, $galleryid);
                         } else {
                             $htmlorscript = $this->getUserDefinedImageGallery($imagepath, $labels, $galleryid);
                         }
                         break;
                     case SIGPLUS_SORT_MTIME:
                         $files = $this->imageservices->getListing($imagepath, SIGPLUS_MTIME, $this->curparams->sortorder, $this->curparams->depth);
                         $htmlorscript = $this->getLabeledImageGallery($imagepath, $files, $labels, $galleryid);
                         break;
                     case SIGPLUS_SORT_RANDOM:
                         $files = $this->imageservices->getListing($imagepath, SIGPLUS_RANDOM, $this->curparams->sortorder, $this->curparams->depth);
                         $htmlorscript = $this->getLabeledImageGallery($imagepath, $files, $labels, $galleryid);
                         break;
                     case SIGPLUS_SORT_RANDOMLABELS:
                         if (empty($labels)) {
                             // there is no labels file to use
                             $files = $this->imageservices->getListing($imagepath, SIGPLUS_RANDOM, $this->curparams->sortorder, $this->curparams->depth);
                             $htmlorscript = $this->getUnlabeledImageGallery($imagepath, $files, $galleryid);
                         } else {
                             shuffle($labels);
                             $htmlorscript = $this->getUserDefinedImageGallery($imagepath, $labels, $galleryid);
                         }
                         break;
                     default:
                         // case SIGPLUS_SORT_FILENAME:
                         $files = $this->imageservices->getListing($imagepath, SIGPLUS_FILENAME, $this->curparams->sortorder, $this->curparams->depth);
                         $htmlorscript = $this->getLabeledImageGallery($imagepath, $files, $labels, $galleryid);
                         break;
                 }
             }
         }
         if (!empty($htmlorscript)) {
             switch ($this->curparams->linkage) {
                 case 'inline':
                     $cachedata = ($slider !== false ? '<ul style="visibility:hidden;">' : '<ul>') . implode($htmlorscript) . '</ul>';
                     break;
                 case 'head':
                     // put generated content in HTML head (does not allow HTML body with bloating size, which would cause preg_replace in System - SEF to fail)
                     $cachedata = $this->getGalleryScript($galleryid, $htmlorscript);
                     break;
                 case 'external':
                     $cachedata = '__jQuery__(function () { ' . $this->getGalleryScript($galleryid, $htmlorscript) . ' });';
                     break;
             }
         } else {
             $cachedata = false;
         }
         // restore default title and description, which might have been overridden in labels file
         $this->curparams->deftitle = $deftitle;
         $this->curparams->defdescription = $defdescription;
         if (SIGPLUS_CONTENT_CACHING && !$this->curparams->hasRandom()) {
             // save generated content for future re-use in a temporary file in the cache folder
             $this->imageservices->cleanCachedContent();
             $cachekey = $this->imageservices->saveCachedContent($imagehashbase, $this->curparams, $cachedata);
             if (SIGPLUS_LOGGING) {
                 if ($cachekey !== false) {
                     $logging->append('Saved cached content with key <kbd>' . $cachekey . '</kbd>.');
                 } else {
                     $logging->append('Failed to persist content in cache folder.');
                 }
             }
         }
     } elseif ($this->curparams->linkage != 'external') {
         // retrieve content from cache but no need to fetch content for linking external .js file
         $cachefile = $this->imageservices->getCachedContentPath($cachekey, $this->curparams->linkage == 'inline' ? '.html' : '.js');
         if (filesize($cachefile) > 0) {
             $cachedata = file_get_contents($cachefile);
         } else {
             $cachedata = false;
             // empty gallery
         }
     } else {
         $cachedata = true;
     }
     if ($cachedata === false) {
         // no content
         $html = JText::_('SIGPLUS_EMPTY');
     } else {
         switch ($this->curparams->linkage) {
             case 'inline':
                 $html = $cachedata;
                 // content produced as HTML only in inline linkage mode
                 break;
             case 'head':
                 $this->addGalleryScript();
                 // add gallery population script
                 $engineservices->addOnReadyScript($cachedata);
                 // add gallery data
                 $html = '';
                 // no content produced in HTML except for placeholder
                 break;
             case 'external':
                 $this->addGalleryScript();
                 if ($cachekey !== false) {
                     // include reference to generated script in external .js file
                     $document = JFactory::getDocument();
                     $document->addScript($this->imageservices->getCachedContentUrl($cachekey, '.js'));
                 } else {
                     // add script to document head as a fall-back if could not save to external .js file in cache folder
                     $engineservices->addOnReadyScript($cachedata);
                 }
                 $html = '';
                 break;
         }
     }
     // set image gallery alignment (left, center or right) and style
     $gallerystyle = 'sigplus-gallery';
     switch ($this->curparams->alignment) {
         case 'left':
         case 'left-clear':
         case 'left-float':
             $gallerystyle .= ' sigplus-left';
             break;
         case 'center':
             $gallerystyle .= ' sigplus-center';
             break;
         case 'right':
         case 'right-clear':
         case 'right-float':
             $gallerystyle .= ' sigplus-right';
             break;
     }
     switch ($this->curparams->alignment) {
         case 'left':
         case 'left-float':
         case 'right':
         case 'right-float':
             $gallerystyle .= ' sigplus-float';
             break;
         case 'left-clear':
         case 'right-clear':
             $gallerystyle .= ' sigplus-clear';
             break;
     }
     switch ($this->curparams->imagecaptions) {
         case 'above':
             $gallerystyle .= ' sigplus-captionsabove';
             break;
         case 'below':
             $gallerystyle .= ' sigplus-captionsbelow';
             break;
     }
     // output image gallery or gallery placeholder
     $div_attrs = array('id' => $galleryid, 'class' => $gallerystyle);
     if ($this->curparams->layout == 'hidden') {
         $div_attrs['style'] = 'display:none !important;';
     }
     $html = make_html('div', $div_attrs, $html);
     // add style and script declarations
     $this->addStylesAndScripts($galleryid);
     $this->curparams = false;
     return $html;
 }
Ejemplo n.º 8
0
function view_comment($tid)
{
    global $dbConnection;
    ?>







		<div class="row" id="comment_body" style="max-height: 400px; scroll-behavior: initial; overflow-y: scroll;">
	
		<div class="timeline-centered">
		<?php 
    $stmt = $dbConnection->prepare('SELECT user_id, comment_text, dt from comments where t_id=:tid order by dt ASC');
    $stmt->execute(array(':tid' => $tid));
    while ($rews = $stmt->fetch(PDO::FETCH_ASSOC)) {
        ?>
		
		<article class="timeline-entry">

			<div class="timeline-entry-inner">

				<div class="timeline-icon bg-info">
					<i class="entypo-feather"></i>
				</div>

				<div class="timeline-label">
													<div class="header">
									<strong class="primary-font"><?php 
        echo nameshort(name_of_user_ret($rews['user_id']));
        ?>
</strong> <small class="pull-right text-muted">
										<span class="glyphicon glyphicon-time"></span> 
										<time id="b" datetime="<?php 
        echo $rews['dt'];
        ?>
"></time> <time id="c" datetime="<?php 
        echo $rews['dt'];
        ?>
"></time></small>
										
								</div><br>
					<p><?php 
        echo make_html($rews['comment_text'], true);
        ?>
</p>
				</div>
			</div>

		</article>
		
		
		

		
		
		
		

							

		<?php 
    }
    ?>
				   
		</div>
	</div>





<?php 
}
Ejemplo n.º 9
0
             $rsdb[content] = show_keyword($rsdb[content]);
             //突出显示关键字
             $IS_BIZ && AvoidGather();
             //防采集处理
             $showpage = getpage("", "", "bencandy.php?fid={$fid}&aid={$aid}", 1, $rsdb[pages]);
             if (!$bencandy_content) {
                 ob_end_clean();
                 ob_start();
                 $MenuArray = '';
                 require ROOT_PATH . "inc/head.php";
                 require $chdb[main_tpl];
                 $bencandy_content = ob_get_contents() . $content_foot;
                 $bencandy_content = preg_replace("/<!--include(.*?)include-->/is", "\\1", $bencandy_content);
                 $bencandy_content = str_replace("<!---->", "", $bencandy_content);
             }
             make_html($bencandy_content, 'bencandy');
             $bencandy_content = '';
             $page++;
             $ifpage = $page > $rsdb[pages] ? false : true;
             $STEPS++;
             if ($STEPS % 100) {
                 sleep(1);
                 //每生成100篇后要暂停一下,防止服务器负荷太大
             }
         } while ($ifpage);
     }
     //对应上面的批量读取文章query
 } while ($ifdo);
 //对应上面的DO
 /***********************结尾***********************/
 ob_end_clean();
Ejemplo n.º 10
0
    } else {
        $classif = "ОКТМО";
    }
    echo date("H:i:s") . " Генерация html для классификатора {$classif}\n\n";
    $time = -time();
    print_table($link, $data_date, $base_table, '', 'html');
    $i = 1;
    $query = 'SELECT mergedcode FROM ' . $base_table . ' WHERE mergedcode<>\'00000000\' AND exist<>0';
    $result = mysqli_query($link, $query);
    $num_pages = mysqli_num_rows($result);
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        $percents = 100 * $i / $num_pages;
        $status = sprintf("%3d", $percents) . '% Обработано ' . sprintf("%7d", $i) . ' из ' . sprintf("%7d", $num_pages) . ' ';
        fwrite(STDERR, "\r{$status}");
        print_table($link, $data_date, $base_table, $row['mergedcode'], 'html');
        $i++;
    }
    $time += time();
    echo "\n\n" . date("H:i:s") . " Генерация html для {$classif} выполнена за " . hms($time) . "\n\n";
}
$link = get_link($db_host, $db_user, $db_pass, $db_name);
$data_date = substr(file_get_contents($work_files_path . 'data_date'), 0, 10);
$time = -time();
make_html($link, $data_date, 'okato');
make_html($link, $data_date, 'oktmo');
$mode = 'html';
include 'l0.php';
include 'lost.php';
$time += time();
echo "\n\n" . date("H:i:s") . ' Генерация html выполнена за ' . hms($time) . "\n\n";
mysqli_close($link);
Ejemplo n.º 11
0
                                
                                
                                

                    </tr>
                    <tr>
                        <td style=" padding: 20px; border-top: 1px solid #DDD " colspan="2">
                        
                        
                        <!--p href="#" data-pk="<?php 
            echo $tid;
            ?>
" data-url="actions.php" id="edit_msg_ticket" data-type="textarea"-->
                        
                        <?php 
            echo make_html($row['msg']);
            ?>
                        
                        
                        <!--/p-->
                        
                         </td>
                    </tr>
                    </tbody>
                </table>


                <?php 
            $stmt = $dbConnection->prepare('SELECT file_hash, original_name, file_size FROM files where ticket_hash=:tid');
            $stmt->execute(array(':tid' => $hn));
            $res1 = $stmt->fetchAll();
Ejemplo n.º 12
0
 public function display($view = '', $return = false)
 {
     global $lable, $list, $datalist, $volist, $data;
     $file = $this->class_info['method'];
     $clas = $this->class_info['file'];
     $tpl = $this->config->get('DEFAULT_TPL');
     if (!$tpl) {
         $tpl = 'default';
     }
     if (COOKIE::get('default_tpl')) {
         $tpl = COOKIE::get('default_tpl');
     }
     if (!defined('DEFAULT_TPL')) {
         define('DEFAULT_TPL', $tpl);
     }
     $data = $this->data;
     ob_start();
     $templete_ext = $this->config->get('templete_ext');
     if (!$templete_ext) {
         $templete_ext = '.htm';
     }
     $v = $clas . "/" . $file . $templete_ext;
     if ($view) {
         $v = $view;
     }
     $file = DEFAULT_TPL_PATH . "/{$tpl}/" . $v;
     foreach ($this->data as $kyphp_key => $kyphp_value) {
         if (is_string($kyphp_value)) {
             $lable[$kyphp_key] = $kyphp_value;
         }
         ${$kyphp_key} = $kyphp_value;
     }
     if (is_file($file)) {
         require $file;
     } else {
         error(0, $file);
     }
     $content = ob_get_contents();
     ob_end_clean();
     $content = make_html($content, $this->config->get('PATH_KEY'));
     if ($this->config->get('PATH_KEY') == 4) {
         $htmlpath = $this->config->get('DEFAULT_HTML_PATH');
         if (!$htmlpath) {
             $htmlpath = 'html';
         }
         $fstr = APP_PATH . '/' . $htmlpath;
         $fstr .= '/' . $this->kyphp_route;
         if (!is_dir($fstr)) {
             mkdir($fstr, 0755, true);
         }
         $f = fopen($fstr . '/index.html', 'w');
         fwrite($f, $content);
         fclose($f);
     }
     if ($this->config->get('CACHE_ON') == 'on') {
         $urlcachekey = 'KYPHP_URL' . $_SERVER['REQUEST_URI'];
         $urlcache = array('dirver' => 'file');
         $kyphpcache = new Cache($urlcache);
         $timeout = 3600;
         if ($this->config->get('CACHE_TIME_EXPIRE')) {
             $timeout = $this->config->get('CACHE_TIME_EXPIRE');
         }
         if ($this->config->get('CACHE_CONTENT_WITHTIME') != 'off') {
             if (!$this->config->get('CACHE_CONTENT_WITHTIME')) {
                 $content = $content . '<!--cached ' . date('Y-m-d H:i:s') . ' by KYPHP-->';
             } else {
                 $content = $content . $this->config->get('CACHE_CONTENT_WITHTIME');
             }
         }
         $kyphpcache->set($urlcachekey, $content, $timeout);
     }
     if ($return) {
         return $content;
     } else {
         echo $content;
     }
     if ($this->config->get('debug') == 'on') {
         $debug = debug_backtrace();
         echo '<div>Debug Trace:<br><ul>';
         global $_charset;
         $this->runtime->stop();
         foreach ($debug as $key => $value) {
             echo "<li>file:{$value['file']} " . sprintf($_charset['lineno'], $value['line']) . " {$value['function']}</li>";
         }
         echo '</ul></div>';
         echo "<div>Time:spent is " . $this->runtime->spent() . " (ms)</div>";
     }
 }
Ejemplo n.º 13
0
function download_tar()
{
    $name = $GLOBALS['form_name'];
    $data = array(".htaccess" => make_htaccess(), "run.php ->" => 'code/wfpl/run.php', "style.css" => read_whole_file('code/wfpl/metaform/style.css'), "{$name}.html" => make_html(), "{$name}.php" => make_php());
    if ($GLOBALS['opt_db'] == 'Yes') {
        $data["{$name}.sql"] = make_sql();
    }
    if ($GLOBALS['opt_email'] == 'Yes') {
        $data["{$name}.email.txt"] = make_email();
    }
    make_tar($name, $data);
}
Ejemplo n.º 14
0
require ROOT_PATH . "inc/head.php";
require html($mid ? "search_{$mid}" : "search");
require ROOT_PATH . "inc/foot.php";
//伪静态
if ($webdb[NewsMakeHtml] == 2) {
    $content = ob_get_contents();
    ob_end_clean();
    ob_start();
    $content = fake_html($content);
    echo "{$content}";
} elseif ($webdb[NewsMakeHtml] == 1) {
    $content = ob_get_contents();
    ob_end_clean();
    ob_start();
    //备用
    $content = make_html($content, 'N');
    echo "{$content}";
}
/*栏目列表 取决模型相关栏目*/
function list_allsort($fid, $Class, $ckfid, $fmid = "0")
{
    global $db, $pre, $listdb;
    $Class++;
    if (!$fmid) {
        $query = $db->query("SELECT * FROM {$pre}sort WHERE fup='{$fid}' ORDER BY list DESC");
    } else {
        $query = $db->query("SELECT * FROM {$pre}sort WHERE fup='{$fid}' AND fmid ='{$fmid}'ORDER BY list DESC");
    }
    while ($rs = $db->fetch_array($query)) {
        $icon = "";
        for ($i = 1; $i < $Class; $i++) {
Ejemplo n.º 15
0
    }
    return $res;
}
function get_mark_price($goods_id)
{
    $sql = "SELECT market_price" . " FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id = '{$goods_id}'";
    $res = $GLOBALS['db']->getRow($sql);
    return $res['market_price'];
}
/* 代码增加_start  By www.ecshop68.com */
/*
 *
 *查询商品的优惠数量和价格 
 *
 *jx   2015-1-1
 */
function get_goods_volume($goods_id)
{
    $volume_price = array();
    $sql = "SELECT volume_number , volume_price" . " FROM " . $GLOBALS['ecs']->table('volume_price') . " WHERE goods_id = '{$goods_id}' ORDER BY volume_number";
    $res = $GLOBALS['db']->getAll($sql);
    foreach ($res as $k => $v) {
        $volume_price[$k] = array();
        $volume_price[$k]['volume_number'] = $v['volume_number'];
        $volume_price[$k]['volume_price'] = price_format($v['volume_price']);
    }
    return $volume_price;
}
/* 代码增加_start  By  www.68ecshop.com */
make_html();
/* 代码增加_end   By  www.68ecshop.com */
Ejemplo n.º 16
0
"></time></center></small></td>

                        <td style=" vertical-align: middle; "><small class="<?php 
                    echo $muclass;
                    ?>
"><?php 
                    echo nameshort(name_of_user_ret($row['user_init_id']));
                    ?>
</small></td>

                        <td style=" vertical-align: middle; "><small class="<?php 
                    echo $muclass;
                    ?>
">
                                <?php 
                    echo make_html($to_text, 'no');
                    ?>
                            </small></td>
                        <td style=" vertical-align: middle; "><small><center>
                                    <?php 
                    echo $st;
                    ?>
 </center>
                            </small></td>

                    </tr>
                <?php 
                }
                ?>
                </tbody>
                </table>
Ejemplo n.º 17
0
    } elseif ($fidDB[allowviewtitle] || $fidDB[allowviewcontent]) {
        //浏览权限
        $atc_content = "<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$webdb['www_url']}{$webdb['path']}/list.php?page={$page}&fid={$fid}&NeedCheck=1'>";
    } else {
        $listdb = ListThisSort($Lrows, $webdb[ListLeng] ? $webdb[ListLeng] : 50);
        //本栏目文章列表
        $listdb || ($hide_listnews = 'none');
        //如果是大分类的话,就不存在标题,就把标题框隐藏
        $showpage = getpage("", "WHERE fid={$fid}", "list.php?fid={$fid}", $Lrows, $NUM);
    }
    ob_end_clean();
    ob_start();
    require html("list", $FidTpl['list']);
    $content = $atc_content ? $atc_content : $content_head . ob_get_contents() . $content_foot;
    $content = preg_replace("/<!--include(.*?)include-->/is", "\\1", $content);
    make_html($content, 'list');
    $ckk++;
}
ob_end_clean();
require_once ROOT_PATH . "cache/htm_cache/{$cacheid}_makelist.php";
if ($ckk) {
    $Ppage++;
    //非批量生成静态,不需要看进度状况
    if ($JumpUrl) {
        //如果是一个栏目的话,只处理前几页就行了
        if (is_numeric($allfid)) {
            unlink(ROOT_PATH . "cache/htm_cache/{$cacheid}_makelist.php");
            header("location:{$JumpUrl}");
            exit;
        }
        //header("location:?fid=$fid&Ppage=$Ppage&III=$III");exit;
Ejemplo n.º 18
0
//显示子分类
$listdb_moresort = ListMoreSp();
//列表页多少篇专题
$rows = 3;
$listdb = ListThisSp($rows, $leng = 50);
//本栏目专题列表
$showpage = getpage("{$pre}special", "WHERE fid={$fid}", "listsp.php?fid={$fid}", $rows);
//专题列表分页
make_html($showpage, 'listsp');
require ROOT_PATH . "inc/head.php";
require html("listsp", $FidTpl['list']);
require ROOT_PATH . "inc/foot.php";
$content = ob_get_contents();
ob_end_clean();
$content = preg_replace("/<!--include(.*?)include-->/is", "\\1", $content);
make_html($content, 'listsp');
require_once ROOT_PATH . "cache/makelist.php";
$page++;
$min = ($page - 1) * $rows;
if ($db->get_one("SELECT * FROM {$pre}special WHERE fid='{$fid}' LIMIT {$min},1")) {
    write_file(ROOT_PATH . "cache/makelist_record.php", "listsp_html.php?fid={$fid}&page={$page}&III={$III}");
    echo "请稍候,正在生成专题列表页静态...{$Ppage}<META HTTP-EQUIV=REFRESH CONTENT='0;URL=?fid={$fid}&page={$page}&III={$III}'>";
    exit;
} else {
    $III++;
    $page = 1;
    $fiddb = explode(",", $allfid);
    if ($fid = $fiddb[$III]) {
        write_file(ROOT_PATH . "cache/makelist_record.php", "?fid={$fid}&page={$page}&III={$III}");
        echo '<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />';
        echo "请稍候,正在生成专题列表页静态...{$fid}<META HTTP-EQUIV=REFRESH CONTENT='0;URL=?fid={$fid}&page={$page}&III={$III}'>";