コード例 #1
0
ファイル: cj.php プロジェクト: dab1993/myeshop
/**
 * 获取文章详情
 * @param type $id
 * @return type
 */
function getArticle($id)
{
    $obj = pickOne($id);
    $body_without_html = htmlToText($obj['body']);
    $obj['description'] = mb_substr($body_without_html, '0', 150, 'utf8');
    $obj['source'] = '绝想日记网';
    /* 设置文章属性 */
    if (!empty($obj['litpic'])) {
        $obj['flag'] = ',f,p';
    }
    if (rand(1, 3) == 2) {
        $obj['flag'] = ',c';
    }
    if (rand(1, 3) == 2) {
        $obj['flag'] = ',h';
    }
    if (rand(1, 3) == 2) {
        $obj['flag'] = ',s';
    }
    $obj['flag'] = ltrim($flag['flag'], ',');
    $obj['flag'] = explode(',', $flag);
    $obj['keywords'] = '随笔坞';
    $obj['qianbian'] = rand(0, 20);
    $obj['zhichi'] = rand(0, 300);
    $obj['zhaoma'] = rand(0, 70);
    $obj['gaoxiao'] = rand(0, 80);
    $obj['chedan'] = rand(0, 100);
    $obj['bujie'] = rand(0, 200);
    $obj['chijing'] = rand(0, 50);
    $obj['henbang'] = rand(0, 200);
    return $obj;
}
コード例 #2
0
function addStdContent($result, $i, $vevent, $asText, $id, $summary)
{
    $start = calendarArray(mysql_result($result, $i, "start_date"));
    $end = calendarArray(mysql_result($result, $i, "end_date"));
    $description = mysql_result($result, $i, "description");
    if ($asText) {
        $description = htmlToText($description);
    }
    $vevent->setProperty('dtstart', $start);
    $vevent->setProperty('dtend', $end);
    $vevent->setProperty('summary', $summary);
    // event title
    $vevent->setProperty('description', $description);
    // shows up in "comment"
    $vevent->setProperty('UID', $id . "@x2011west.org");
    // needed for multiple downloads
}
コード例 #3
0
ファイル: default.php プロジェクト: mul14/FiyoCMS
				
				<div class=""><h2 class="title"><?php 
            echo $title[$i];
            ?>
</h2>
				
				<div class='pdf_panel'>	
					<span>
					<?php 
            echo "<b><i>{$author[$i]}</i></b> &#183;  {$category[$i]} &#183; Th.{$date[$i]}";
            ?>
					</span>	
				</div>
			<div class="clear"></div>
				<?php 
            echo cutWords(htmlToText($text[$i]), 40);
            ?>
						
				</div>	
			</div>	
			
		</div>	
		<?php 
        }
        ?>
		
		<div class="pdf_main">
			<?php 
        echo $pagelink;
        ?>
		</div>
コード例 #4
0
ファイル: gui.php プロジェクト: BackupTheBerlios/infobasar
function guiExternLink(&$session, $link, $text)
{
    $session->trace(TC_Gui2, 'guiExternLink');
    echo TAG_ANCOR_HREF;
    echo $link;
    echo TAG_APO_SUFFIX;
    echo htmlToText($session, $text);
    echo TAG_ANCOR_END;
}
コード例 #5
0
ファイル: gui.php プロジェクト: BackupTheBerlios/infobasar
function guiExternLink(&$session, $link, $text)
{
    $session->trace(TC_Gui2, 'guiExternLink');
    echo "<a href=\"{$link}\">";
    echo htmlToText($session, $text);
    echo "</a>\n";
}
コード例 #6
0
ファイル: list_comment.php プロジェクト: mul14/FiyoCMS
     $enable = 'disable';
 }
 $name = "{$aRow['name']}";
 $name = "<span class='tips' title='{$aRow['email']}' data-placement='right'>{$name}</span>";
 $status = "<span class='invisible'>{$enable}</span>\n\t\t\t\t<div class='switch s-icon activator'>\n\t\t\t\t\t<label class='cb-enable {$stat1} tips' data-placement='right' title='" . Disable . "'><span>\n\t\t\t\t\t<i class='icon-remove-sign'></i></span></label>\n\t\t\t\t\t<label class='cb-disable {$stat2} tips' data-placement='right' title='" . Enable . "'><span>\n\t\t\t\t\t<i class='icon-ok-sign'></i></span></label>\n\t\t\t\t\t<input type='hidden' value='{$aRow['id']}' class='number invisible'>\n\t\t\t\t\t<input type='hidden' value='{$aRow['status']}'  class='type invisible'>\n\t\t\t\t</div>";
 if ($i == 0) {
     $row[] = "<label><input type='checkbox' data-name='rad-{$aRow['id']}' name='check_comment[]' value='{$aRow['id']}' rel='ck' ><span class='input-check'></span></label>";
 } else {
     if ($i == 1) {
         $row[] = $name;
     } else {
         if ($i == 2) {
             $row[] = "<div class='center'>{$status}</div>";
         } else {
             if ($i == 3) {
                 $comm = htmlentities(htmlToText($aRow['comment']));
                 $comm = substr($comm, 0, 50);
                 $comm = "<a class='tips' title='" . Edit . "' href='?app=article&view=comment&act=edit&id={$aRow['id']}'>{$comm} ...</a>";
                 $row[] = "{$comm}";
             } else {
                 if ($i == 4) {
                     $title = oneQuery('article', 'id', link_param('id', $aRow['link']), 'title');
                     $link = oneQuery('permalink', 'link', "'{$aRow['link']}'", 'permalink');
                     $clink = "#comment-{$aRow['id']}";
                     $title = "<span style='display:none'>{$title}</span><a href='../{$link}{$clink} ' target='_blank' class='outlink'>{$title}</a> ";
                     $row[] = "{$title}";
                 } else {
                     if ($i == 5) {
                         $row[] = "<div class='center'>{$aRow['date']}</div>";
                     } else {
                         if ($aColumns[$i] != ' ') {
コード例 #7
0
ファイル: plg_system.php プロジェクト: mul14/FiyoCMS
function generateKeywords($text)
{
    $parsearray[] = htmlToText($text);
    $parsestring = "z " . strtolower(join($parsearray, " ")) . " y";
    $parsestring = str_replace(",", "", $parsestring);
    $parsestring = str_replace(")", "", $parsestring);
    $parsestring = str_replace("(", "", $parsestring);
    $parsestring = str_replace(".", "", $parsestring);
    $parsestring = str_replace("'", "", $parsestring);
    $parsestring = str_replace('"', "", $parsestring);
    $parsestring = str_replace("\n", "", $parsestring);
    $parsestring = str_replace("\t", " ", $parsestring);
    $parsestring = str_replace("&gt;", " ", $parsestring);
    $parsestring = str_replace("&amp;", "", $parsestring);
    $parsestring = str_replace("&nbsp;", " ", $parsestring);
    $commonwords = <<<EOF
the a if i you to when of if can while was and it in that with my so at for up on by this from be as me some her she time again were down back would his brother both all one needed not had after there out lot quite many know no but like who your will we is are or our have an more what us which its being anda kita kami jika untuk lalu dari dapat hingga dan itu dalam bahwa dengan saya sehingga jadi di pada untuk oleh ini dari menjadi sebagai bisa melalui akan ingin pilih yang dapatkan tentang menemukan yaitu adalah saya beberapa dia waktu lagi mana kembali atau into ? / - later these : . " ' following \\ such over ensure months
EOF;
    $commonarray = @split(" ", $commonwords);
    for ($i = 0; $i < count($commonarray); $i++) {
        $parsestring = str_replace(" " . $commonarray[$i] . " ", " ", $parsestring);
    }
    $parsestring = str_replace("  ", " ", $parsestring);
    $parsestring = str_replace("  ", " ", $parsestring);
    $parsestring = str_replace("  ", " ", $parsestring);
    $wordsarray = @split(" ", $parsestring);
    for ($i = 0; $i < count($wordsarray); $i++) {
        $word = $wordsarray[$i];
        if (@$freqarray[$word]) {
            $freqarray[$word] += 1;
        } else {
            $freqarray[$word] = 1;
        }
    }
    @arsort($freqarray);
    $i = 0;
    while (list($key, $val) = each($freqarray)) {
        $i++;
        $freqall[$key] = $val;
        if ($i == 15) {
            break;
        }
    }
    for ($i = 0; $i < count($wordsarray) - 1; $i++) {
        $j = $i + 1;
        $word2 = $wordsarray[$i] . " " . $wordsarray[$j];
        if (@$freqarray2[$word2]) {
            $freqarray2[$word2] += 1;
        } else {
            $freqarray2[$word2] = 1;
        }
    }
    @arsort($freqarray2);
    $i = 0;
    while (list($key, $val) = each($freqarray2)) {
        $i++;
        $freqall[$key] = $val;
        if ($i == 4) {
            break;
        }
    }
    for ($i = 0; $i < count($wordsarray) - 2; $i++) {
        $j = $i + 1;
        $word3 = $wordsarray[$i] . " " . $wordsarray[$j] . " " . $wordsarray[$j + 1];
        if (@$freqarray3[$word3]) {
            $freqarray3[$word3] += 1;
        } else {
            $freqarray3[$word3] = 1;
        }
    }
    @arsort($freqarray3);
    $i = 0;
    while (list($key, $val) = each($freqarray3)) {
        $i++;
        $freqall[$key] = $val;
        if ($i == 1) {
            break;
        }
    }
    arsort($freqall);
    $keys = $pagecontents = "";
    while (list($key, $val) = each($freqall)) {
        $pagecontents .= "{$key} => {$val}<br>";
        if (strlen($key) > 2) {
            $keys .= "{$key}, ";
        }
    }
    chop($keys);
    return $keys;
}
コード例 #8
0
ファイル: view_comment.php プロジェクト: mul14/FiyoCMS
		<tbody>
			<?php 
$db = new FQuery();
$db->connect();
$no = 1;
$sql = $db->select(FDBPrefix . 'comment', '*', '', "id DESC");
while ($qr = mysql_fetch_array($sql)) {
    /* logika status aktif atau tidak */
    if ($qr['status'] == 1) {
        $stat1 = "selected";
        $stat2 = "";
    } else {
        $stat2 = "selected";
        $stat1 = "";
    }
    $status = "\n\t\t\t\t<p class='switch'>\n\t\t\t\t\t<label class='cb-enable {$stat1}'><span>Show</span></label>\n\t\t\t\t\t<label class='cb-disable {$stat2}'><span>Hide</span></label>\n\t\t\t\t\t<input type='text' value='{$qr['id']}' id='id' class='invisible'><input type='text' value='stat' id='type' class='invisible'>\n\t\t\t\t</p>";
    $name = "<a class='tooltip ctedit' title='" . Click_to_edit . "' href='?app=comment&act=edit&id={$qr['id']}'>{$qr['name']}</a>";
    $check = "<input type='checkbox' name='check[]' value='{$qr['id']}' rel='ck'>";
    $link = str_replace("http://" . FUrl, "", make_permalink($qr['link']));
    $comm = htmlentities(htmlToText($qr['comment']));
    $comm = substr($comm, 0, 60);
    $comm = "<a href='" . make_permalink($qr['link']) . "#comment-{$qr['clink']}' target='_blank' class='tooltip outlink' title='" . See_comments . "'>{$comm} . . .</a> ";
    echo "<tr>";
    echo "<td>{$no}</td><td align='center'>{$check}</td><td>{$name}</td><td>{$qr['email']}</td><td align='center'>{$status}</td><td>{$comm}</td>";
    echo "</tr>";
    $no++;
}
?>
        </tbody>			
	</table>
</form>
コード例 #9
0
ファイル: comments.php プロジェクト: mul14/FiyoCMS
$db->connect();
$user_id = USER_ID;
if (USER_LEVEL > 3) {
    $sql = $db->select(FDBPrefix . "comment", "*,DATE_FORMAT(date,'%W, %b %d %Y') as dates", "parent_user_id = {$user_id} OR thread_user_id = {$user_id}", 'date DESC LIMIT 10');
    echo USER_LEVEL;
} else {
    $sql = $db->select(FDBPrefix . "comment", "*,DATE_FORMAT(date,'%W, %b %d %Y') as dates", "", 'date DESC LIMIT 10');
}
$no = 0;
while ($qr = mysql_fetch_array($sql)) {
    $id = "{$qr['id']}";
    $auth = "{$qr['name']}";
    $info = "{$qr['date']}";
    $imgr = md5("{$qr['email']}");
    $foto = " <span class='c_gravatar' data-gravatar-hash=\"{$imgr}\"></span>";
    $comment = cutWords(htmlToText($qr['comment']), 10);
    $hide = Hide;
    $cedit = Edit;
    $read = Read;
    $delete = Delete;
    $approve = Approve;
    $app = link_param('app', "{$qr['link']}");
    $aid = link_param('id', "{$qr['link']}");
    $app = "{$qr['apps']}";
    if (empty($app)) {
        $app = 'article';
    }
    $lread = $_POST['url'] . check_permalink("link", "?app=article&view=item&id={$aid}", "permalink");
    $edit = "?app={$app}&view=comment&act=edit&id={$id}";
    $title = oneQuery('article', 'id', $aid, 'title');
    $red = '';
コード例 #10
0
function loadClinics($v, $asText = TRUE, $where = NONE)
{
    global $opts, $event_tools_db_prefix;
    if ($where != NONE) {
        $where = " WHERE " . $where;
    }
    $query = "\r\n        SELECT *\r\n        FROM " . $event_tools_db_prefix . "eventtools_clinics_with_tags\r\n        " . $where . "\r\n        ORDER BY start_date, end_date, name\r\n        ;\r\n    ";
    //echo $query;
    $result = mysql_query($query);
    $i = 0;
    $num = mysql_numrows($result);
    $lastmajorkey = '';
    while ($i < $num) {
        // ensure synch, shouldn't be needed
        if ($lastmajorkey != mysql_result($result, $i, "start_date") . mysql_result($result, $i, "name")) {
            $lastmajorkey = mysql_result($result, $i, "start_date") . mysql_result($result, $i, "name");
            $vevent = new vevent();
            $pre = "Clinic: ";
            if (mysql_result($result, $i, "status_code") == '80') {
                $pre = "(Cancelled) ";
            }
            $summary = $pre . htmlToText(mysql_result($result, $i, "name")) . " (" . htmlToText(mysql_result($result, $i, "clinic_presenter")) . ")";
            addStdContent($result, $i, $vevent, $asText, mysql_result($result, $i, "number"), $summary);
            $location = mysql_result($result, $i, "location_name");
            $clinic_url = mysql_result($result, $i, "clinic_url");
            $vevent->setProperty('LOCATION', $location);
            if ($clinic_url != "") {
                $vevent->setProperty('URL', $clinic_url);
            }
            // duplicate records hold tags; NULL tag if 1st record has no tag
            $tags = array();
            $k = $i;
            while ($k < $num) {
                if ($lastmajorkey == mysql_result($result, $k, "start_date") . mysql_result($result, $k, "name")) {
                    // tag
                    $tags[] = mysql_result($result, $k, "tag_name");
                    $k++;
                } else {
                    break;
                }
            }
            $vevent->setProperty('categories', $tags);
            $v->setComponent($vevent);
        }
        $i++;
    }
}