Exemplo n.º 1
0
function rec_createStruct($Page)
{
    static $level = -1;
    global $openPageNodes;
    foreach ($Page->Childs() as $id => $SubPage) {
        $level++;
        $AccessP = $SubPage->accessInheritParent();
        $open = isset($openPageNodes[$SubPage->id]);
        echo '<tr pid=' . $SubPage . ' class=' . ($SubPage->vs['access'] === null ? '-inherited' : '') . '>';
        echo '<td style="text-align:right; font-weigth:bold">';
        echo '<a title="als Startpunkt setzen" href="' . Url()->addParam('rp', $id) . '">' . $SubPage . '</a>';
        echo '<td style="padding-left:' . $level * 15 . 'px; white-space:nowrap">';
        if ($SubPage->Childs()) {
            echo '<a class="toggle ' . ($open ? 'minus' : 'plus') . '" href="' . URL()->addParam('opns[' . $SubPage . ']', $open ? 0 : 1) . '"></a>';
        } else {
            echo '<span class=toggle></span>';
        }
        echo '<a href="' . $SubPage->url() . '" title="' . (string) $SubPage->title() . '">' . ((string) $SubPage->title() ? cutText($SubPage->title(), 50) : '(kein Text)') . '</a>';
        if ($SubPage->access() > 2) {
            echo '<td v="' . $AccessP->vs['access'] . '" class=-all>';
        } else {
            echo '<td style="font-style:italic;">';
        }
        foreach (D()->query("SELECT grp.id, grp.name, pg.access AS access FROM grp LEFT JOIN page_access_grp pg ON grp.id = pg.grp_id AND pg.page_id = '" . $AccessP . "' WHERE grp.page_access") as $vs) {
            if ($SubPage->access() > 2) {
                echo '<td gid=' . $vs['id'] . ' v="' . $vs['access'] . '" title="' . $vs['name'] . ' (' . $vs['id'] . ')">' . '';
            } else {
                echo '<td>';
            }
        }
        if ($open) {
            rec_createStruct($SubPage);
        }
        $level--;
    }
}
Exemplo n.º 2
0
    ?>
-fanart.jpg" /></a>
						</div>
						<div class="details">
							<?php 
    echo addSubscribeText($randomshows->isSubscribed(), $randomshows->getID(), 1);
    ?>
							<h3><a href="show.php?showid=<?php 
    echo $randomshows->getID();
    ?>
"><?php 
    echo $randomshows->getTitle();
    ?>
</a></h3>
							<span><?php 
    echo cutText($randomshows->getPlot(), 220);
    ?>
</span>
						</div>
					</div><?php 
}
?>
					<div class="contentbox normalbox">
						<h3>Show list</h3>
						<ul>
							<?php 
for ($i = $numRows / 2; $i < $numRows; $i++) {
    $row = mysql_fetch_array($q, MYSQL_ASSOC);
    ?>
<li><a href="show.php?showid=<?php 
    echo $row['id'];
Exemplo n.º 3
0
             if ($q == 7) {
                 $enc = 'À';
             }
             if ($q == 8) {
                 $enc = 'Ë';
             }
             if ($q == 9) {
                 $enc = 'ç';
             }
             $keyword_hash = $keyword_hash . $enc;
         }
         $keywords[$q]['keyword_hash'] = $keyword_hash;
         $export_textad_description_full = str_replace('{keyword:' . $keyword . '}', $keyword_hash, $export_textad_description_full);
         $q++;
     }
     $export_textad_description_line1 = cutText($export_textad_description_full, 35);
     $line1_len = strlen($export_textad_description_line1);
     $export_textad_description_line2 = substr($export_textad_description_full, $line1_len);
     //now add the dynamic key=>words back in
     for ($x = 0; $x < $q; $x++) {
         $keyword = $keywords[$x]['keyword'];
         $keyword_hash = $keywords[$x]['keyword_hash'];
         $export_textad_description_line1 = str_replace($keyword_hash, '{keyword: ' . $keyword . '}', $export_textad_description_line1);
         $export_textad_description_line2 = str_replace($keyword_hash, '{keyword: ' . $keyword . '}', $export_textad_description_line2);
     }
     $export_textad_description_line1 = $export_textad_row['export_textad_description_full'];
     //else if this is a gogle campaign, it should already be split into two lines
 } else {
     $export_textad_description_line1 = $export_textad_row['export_textad_description_line1'];
     $export_textad_description_line2 = $export_textad_row['export_textad_description_line2'];
 }
Exemplo n.º 4
0
 global $aCont;
 static $level = -1;
 global $openPageNodes;
 foreach ($Page->Childs() as $id => $SubPage) {
     $level++;
     $open = isset($openPageNodes[$SubPage->id]);
     echo '<tr>';
     echo '<td style="text-align:right; font-weigth:bold">';
     echo '<a title="als Startpunkt setzen" href="' . Url()->addParam('rp', $id) . '">' . $SubPage . '</a>';
     echo '<td style="padding-left:' . $level * 15 . 'px; white-space:nowrap">';
     if ($SubPage->Childs()) {
         echo '<a class="toggle ' . ($open ? 'minus' : 'plus') . '" href="javascript:$fn(\'page::reloadPart\')(' . $aCont . ',\'tbody.list\',{toggleOpen:' . $SubPage . ',value:' . ($open ? 0 : 1) . '}).run()"></a>';
     } else {
         echo '<span class="toggle"></span>';
     }
     echo '<a href="' . $SubPage->url() . '" title="' . (string) $SubPage->title() . '">' . ((string) $SubPage->title() ? cutText($SubPage->title(), 50) : '(kein Text)') . '</a>';
     echo '<td>';
     $ok = !$SubPage->vs['online_start'] || $SubPage->vs['online_start'] < time();
     $datetime = $SubPage->vs['online_start'] ? strftime('%d.%m.%Y %H:%M', $SubPage->vs['online_start']) : '';
     $date = $SubPage->vs['online_start'] ? strftime('%d.%m.%Y', $SubPage->vs['online_start']) : '---';
     switch ($SubPage->access()) {
         case '0':
             echo '---';
             break;
         case '1':
             echo '<span style="color:' . ($ok ? '#8a8' : '#a88') . '">' . $date . '</span>';
             break;
         default:
             echo '<div style="position:relative"><span onclick="editOnline(this, ' . $SubPage . ', \'' . $datetime . '\')" style="color:' . ($ok ? 'green' : 'red') . '">' . $date . '</span></div>';
     }
     echo '<td>';
Exemplo n.º 5
0
                ?>
</option>
				<option value="Not approved" <?php 
                if ($Comments['status'] == 'Not approved') {
                    echo "selected='selected'";
                }
                ?>
><?php 
                echo $lang['Comments_Not_approved'];
                ?>
</option>
            </select>
            </form>			
        </td>
        <td class="bodylist"><?php 
                echo cutText(ReadDB($News["title"]), 70);
                ?>
</td>
        <td class="bodylist"><?php 
                echo ReadDB($Comments["ipaddress"]);
                ?>
 - <a class="view" href='admin.php?act=BanIP&ip_addr=<?php 
                echo ReadDB($Comments["ipaddress"]);
                ?>
' onclick="return confirm('Are you sure you want to ban IP - <?php 
                echo ReadDB($Comments["ipaddress"]);
                ?>
 ?');"><?php 
                echo $lang['Comments_Ban'];
                ?>
</a></td>
Exemplo n.º 6
0
                        
                                    <div class="comment-parent">
                                        <div class="cm-title">
                                            <a href="<?php 
        echo get_permalink($comment->ID);
        ?>
"><h5 class="site-titles"><?php 
        echo cutText($comment->post_title, 20);
        ?>
</h5></a>
                                        </div>

                                        <div class="cm-text">
                                            <p><i class="fa fa-quote-left left"></i></p>
                                            <p style="margin:10px;"><?php 
        echo cutText($comment->comment_content, 200);
        ?>
</p>
                                            <p><i class="fa fa-quote-right right"></i></p>
                                        </div>

                                        <div class="cm-footer">
                                            <p class="left"><?php 
        $date = date("l, j F Y, H:i");
        echo $date;
        ?>
</p>
                                            <p class="right">~<?php 
        echo comment_author();
        ?>
</p>
Exemplo n.º 7
0
<?php

/////////////////////////
// LATEST COMMENTS
/////////////////////////
$tpl->setCacheKey('cached/latest_comment.tpl', 'latest_comment');
if ($tpl->isCached('cached/latest_comment.tpl', 60) == false) {
    $rs = $db->select('SELECT
            c.date      AS date,
            c.name      AS name,
            c.message   AS message

            FROM  map_comment AS c
            JOIN  map         AS m ON c.map_id=m.id

            WHERE     c.status = 1
            AND       m.date < ' . time() . '
            AND       m.status = 1

            ORDER BY c.date DESC', 0, 14);
    foreach ($rs['result'] as $key => $item) {
        $tpl->assignLoopVar('comment', array('date' => timeWarp($item['date']), 'name' => $item['name'], 'message' => encodeCurly(cutText($item['message'], 120))));
    }
}
Exemplo n.º 8
0
	function submitnew($username,$password,$status,$category,$url,$title,$content,$tags,$autovote){
		$uid = authen($username,$password);
		if($uid == 0){
			echo "Login fail!";
			exit();
		}
		
		$sql = "select link_id from ".table_prefix."links where link_url like '$url'";
		$rx = mysql_query($sql) or die(mysql_error());
		$n = mysql_num_rows($rx);
		if($n > 0){
			echo "Duplicated Story!!!";
			exit();
		}
		
		if($category == '') $category = 0; // all category
		
		if($status == 1)
			$link_status = 'discard'; // do not show
		else if ($status == 2)
			$link_status = 'queued'; // upconmming
		else if ($status == 3)
			$link_status = 'published'; // show
		else
			$link_status = 'discard'; // spam

		$randkey = rand(10000,10000000);
		$dt = date('Y-m-d H:i:s',time());
		
		$mtitle = ereg_replace("[^A-Za-z0-9 ]", "", $title);
		if($mtitle == ''){
			echo "Submit error!, English title only.";
			exit();
		}
		
		
		$mtitle = strtolower($mtitle);
		$mtitle = str_replace(" ","-",$mtitle);
		
		$sql = "select link_id from ".table_prefix."links where link_title like '$title'";
		$rm = mysql_query($sql) or die(mysql_error());
		$m = mysql_num_rows($rm);
		if($m > 0){
			$mtitle = $mtitle."-".$m;
		}
		
		$scontent = cutText($content,150);
				
		$sql = "insert into ".table_prefix."links(link_author, link_status, link_randkey, link_votes, link_karma, link_modified, link_date, link_published_date, link_category, link_url, link_url_title, link_title, link_title_url, link_content, link_summary, link_tags) values($uid, '$link_status', $randkey, 1, 1, '$dt', '$dt', '1999-11-30 13:00:00', $category, '$url', '$title', '$title', '$mtitle', '$content', '$scontent', '$tags' )";
		$rs = mysql_query($sql) or die(mysql_error());
		if($rs){
			$lastid = mysql_insert_id();
			$dt = date('Y-m-d H:i:s',time());
			$tag = explode(",",$tags);
			for($i=0;$i<sizeof($tag);$i++){
				// insert tag tables
				$sql = "insert into ".table_prefix."tags(tag_link_id, tag_date, tag_words) values($lastid, '$dt', '".$tag[$i]."')";
				mysql_query($sql) or die(mysql_error());
			}
			// update totals table
			$sql = "update ".table_prefix."totals set total = total + 1 where name = '".$link_status."'";
			mysql_query($sql) or die(mysql_error());
			
			// Default Vote
			$dt = date('Y-m-d H:i:s',time());
			$ip = $_SERVER['REMOTE_ADDR'];
			$sql = "insert into ".table_prefix."votes(vote_date, vote_link_id, vote_user_id, vote_value, vote_ip) values('$dt', $lastid, $uid, 10, '$ip')";
			mysql_query($sql) or die(mysql_error());
			
			// count links
			$sql = "select link_id from ".table_prefix."links";
			$rr = mysql_query($sql) or die(mysql_error());
			$num = mysql_num_rows($rr);
			
			// Random Vote
			if($autovote && $num > 1){
				while(1){
					srand((double) microtime() * 1000000); 
					$lucky = rand(1,$num);
					
					$sql = "select link_id from ".table_prefix."links where link_status <> 'discard' and link_id != $lastid and link_id = ".$lucky;
					$ru = mysql_query($sql) or die(mysql_error());
					$u = mysql_num_rows($ru);
					if($u > 0)	break;
					
				}
				
				$sql = "update ".table_prefix."links set link_votes = link_votes + 1 where link_status <> 'discard' and link_id = ".$lucky;
				mysql_query($sql) or die(mysql_error());
				
				$dt = date('Y-m-d H:i:s',time());
				//$ip = $_SERVER['REMOTE_ADDR'];
				$sql = "insert into ".table_prefix."votes(vote_date, vote_link_id, vote_user_id, vote_value, vote_ip) values('$dt', $lucky, $uid, 10, '$ip')";
				mysql_query($sql) or die(mysql_error());
			} // end auto vote
			
			echo "Submit complete!<br>";
		}else{
			echo "Submit fail!<br>";
		}
	}
Exemplo n.º 9
0
            if (ord(substr($string, $i, 1)) > 129) {
                $i++;
            }
        }
        if (strlen($tmpstr) < $strlen) {
            $tmpstr .= "...";
        }
        return $tmpstr;
    }
}
$dbhost = '119.254.229.23';
$dbuser = 'root';
$dbpass = '123456';
$dbname = 'osscms';
$dbport = 3306;
$dbinst = new MySQLDatabase();
$dbinst->dbconnect($dbhost, $dbuser, $dbpass, $dbname);
$dbinst->query("SET NAMES utf8");
$divstr = "<html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head>  \n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n<title></title>\n<link href=\"http://soft.csip.org.cn/css/style.css\" rel=\"stylesheet\" type=\"text/css\" >\n<link href=\"http://soft.csip.org.cn/css/layout.css\" rel=\"stylesheet\"  type=\"text/css\" >\n<style type=\"text/css\" >\nbody {\n\tcolor:#333333;\n\tfont-family:\"宋体\" arial;\n\tfont-size:12px;\n\tfont-size-adjust:none;\n\tfont-style:normal;\n\tfont-variant:normal;\n\tfont-weight:normal;\n}\n\n.m03_a_bt a {\n\twidth:280px;\n\tline-height:24px;\n\tfont-size: 12px;\n}\n.nd {font-size:12px;}\n.m03_a_bt a:link, .m03_a_bt a:visited { font-size:12px; color: #333333; text-decoration: none;}\n.m03_a_bt a:hover { font-size:12px; color:#f00;\t}\n\n</style>\n</head>\n<body>";
$divstr .= "<div> <table class=\"m03_a_bt\" width=\"290\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$strSQL = sprintf("SELECT itemid, subject FROM oss_spaceitems WHERE folder=1 ORDER BY lastpost DESC limit 0, 7");
$result = $dbinst->query($strSQL);
while ($myrow = $dbinst->fetchArray($result)) {
    $news_url = "http://oss.org.cn/?action-viewnews-itemid-" . $myrow['itemid'];
    $news_subject = cutText($myrow['subject'], 0, 30, 'UTF-8') . "...";
    $divstr .= "<tr><td width=\"290\" ><a href=\"{$news_url}\" target=\"_blank\" >{$news_subject}</a></td></tr>";
}
$dbinst->freeRecordSet($result);
$divstr .= "</table></div></body></html>";
echo $divstr;
exit;
Exemplo n.º 10
0
                                            <a href="<?php 
            the_permalink();
            ?>
"><h3 class="site-titles"><?php 
            the_title();
            ?>
</h3></a>
                                            <!-- Opis przepisu -->
                                            <div class="medium-12 op-desc-wrapper">
                                                <?php 
            trc_print_thumbnail($post->ID);
            ?>
                                                <div class="op-desc-to-show">
                                                    <div class="medium-12 columns op-desc">
                                                        <?php 
            echo cutText(get_the_excerpt(), $excerpt_length);
            ?>
                                                        <a class="right" href="<?php 
            the_permalink();
            ?>
">Zobacz przepis...</a>
                                                    </div>
                                                </div>
                                            </div>
                                            <!-- Podtytuł i ocena przepisu -->
                                            <div class="medium-12 columns">
                                                <h5 class="left"><i class="fa fa-comments-o"></i> <?php 
            comments_number('0 komentarzy', '1 komentarz', '% komentarzy');
            ?>
</h5>
                                                <h5 class="right rating">
Exemplo n.º 11
0
            ?>

			<span style="display:block; height:66px;padding-left:4px;padding-right:4px; font-size: <?php 
            echo $OptionsVis["sl_summ_font_size"];
            ?>
px; line-height: <?php 
            echo $OptionsVis["sl_summ_font_size"] + 4;
            ?>
px; font-family: <?php 
            echo $OptionsVis["sl_summ_font_family"];
            ?>
; color:<?php 
            echo $OptionsVis["sl_summ_color"];
            ?>
;"><?php 
            echo cutText(ReadDB($News["summary"]), $OptionsVis["sl_summ_num_char"]);
            ?>
</span>
            <a href="<?php 
            if (trim($Options["news_link"]) != '') {
                echo ReadDB($Options["news_link"]) . "?id=" . $News['id'];
            } else {
                echo $thisPage . "?tid=" . $News['id'];
            }
            ?>
&cat_id=<?php 
            echo $News["cat_id"];
            ?>
#ontitle"> 
            <span style="display:block; padding-left:4px;padding-bottom:2px; font-size:11px;">&raquo; <?php 
            echo $OptionsLang['Read_more'];
Exemplo n.º 12
0
<div style="height:100%; overflow:auto">
	<?php 
if (count($Cont->Conts())) {
    ?>
	<ul id="flexibleContsList">
		<?php 
    foreach ($Cont->Conts() as $C) {
        ?>
			<li itemid="<?php 
        echo $C;
        ?>
">
				<?php 
        echo $C->vs['sort'] . ' ';
        $title = cutText(strip_tags($C->title()), 40);
        echo $title ? $title : '(kein Text)';
        echo ' <b>(' . $C . ')</b>';
        ?>
		<?php 
    }
    ?>
	</ul>
	<?php 
}
?>
</div>
<script>
$('#flexibleContsList').sortable({
	stop: function(e,data) {
		var id = data.item.attr('itemid');
		var next = data.item.next();
Exemplo n.º 13
0
 function highlightText($text, $phrase, $searchType)
 {
     $text = strip_tags(str_replace('<br />', ' ', $text));
     $text1 = strtolower_rus($text);
     $phrase = str_replace('$', '&#036;', $phrase);
     $GLOBALS['bytes'] = array();
     /* Array containing list of begin and end bytes, between them "bold" selection will be inserted. List if formed basing on search phrase(s) when analyzing text by getBytes() */
     if ($phrase != '' and $searchType != 2) {
         $words = explode(' ', $phrase);
         foreach ($words as $w) {
             $w = trim(strtolower_rus($w));
             if ($w != '' and strlen($w) > 2) {
                 getBytes($text1, $w);
             }
             //$text1=str_replace($w, '<strong>'.$w.'</strong>', $text1);
         }
     } elseif ($phrase != '' and $searchType == 2) {
         getBytes($text1, trim(strtolower_rus($phrase)));
     }
     $text = boldText($text, $GLOBALS['bytes']);
     return cutText($text, $GLOBALS['bytes']);
 }
Exemplo n.º 14
0
    ?>
</h3></a>
                                    <!-- Opis przepisu -->
                                    <div class="medium-12 op-desc-wrapper">
                                        <?php 
    // Jeśli post nie ma miniaturki - przypisujemy mu domyślną miniaturkę dla wpisu.
    if (has_post_thumbnail($post->ID)) {
        the_post_thumbnail('post-thumbnail', array('class' => 'op-desc-trigger'));
    } else {
        echo '<img class="op-desc-trigger" src="' . THEME_URL . 'images/8.jpg" alt="Zdjęcie wpisu" />';
    }
    ?>
                                        <div class="op-desc-to-show">
                                            <div class="medium-12 columns op-desc">
                                                <?php 
    echo cutText(get_the_excerpt(), 100);
    ?>
                                                <a class="right" href="<?php 
    the_permalink();
    ?>
">Zobacz restaurację.</a>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- Podtytuł i ocena przepisu -->
                                    <div class="medium-12 columns">
                                        <h5 class="left">Na każdą okazję</h5>
                                        <h5 class="right rating">
                                            <?php 
    showRating($post->ID);
    ?>