function getLatestNews($name_kat) { global $wgOut, $parser; $m_dbObj =& wfGetDB(DB_SLAVE); $m_tblCatLink = $m_dbObj->tableName('categorylinks'); $m_tblPage = $m_dbObj->tableName('page'); #$m_sql = "SELECT * FROM $m_tblCatLink l WHERE cl_to = '".$name_kat."' ORDER BY cl_timestamp DESC LIMIT 1"; $m_sql = "SELECT cl_to,cl_from,page_id,cl_timestamp,page_title FROM {$m_tblCatLink} l, {$m_tblPage} p WHERE cl_to = '" . $name_kat . "' AND l.cl_from = p.page_id GROUP BY cl_timestamp DESC LIMIT 1"; $m_res = $m_dbObj->query($m_sql, __METHOD__); $m_row = $m_dbObj->fetchRow($m_res); $latestNewsPic = getPicture($m_row['cl_from']); $latestNews = "[[Image:" . $latestNewsPic . "|link=" . $m_row['page_title'] . "|250px]]"; $m_dbObj->freeResult($m_res); $latestNews = $wgOut->parse($latestNews); return $latestNews; }
<div class="row-fluid"> <div class="span6"> <div class="block-fluid ucard clearfix"> <div class="left"> <h4><?php echo $myname; ?> </h4> <!-- image upload --> <div class="image"> <?php $imagepath = getPicture($myname); ?> <a href="#"> <img src="<?php echo $imagepath; ?> " class="img-polaroid" style="width:110px;height:110px" > </a> </div> <ul class="control"> <li><span class="icon-pencil"></span> <a href="edit.php">Edit</a></li> </ul> </div> <div class="info"> <ul class="rows"> <li class="heading">User info</li> <li>
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation" style="background-color: #000;"> <div class="container"> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse"> <i class="fa fa-bars"></i> </button> <span class="navbar-brand" style="margin-top: -5px;"> <?php if (isLoggedIn()) { ?> <h1 class="navbar-displayname"> <img src="<?php echo getPicture(); ?> " style="height: 50px;" /> <div class="visible-inline-xs"><?php echo getName(15); ?> </div> <div class="visible-inline-sm"><?php echo getName(15); ?> </div> <div class="visible-inline-md"><?php echo getName(25); ?> </div> <div class="visible-inline-lg"><?php echo getName(30);
} </style> <?php $imagesDir = '../pictures/Architects/'; $images = glob($imagesDir . '*.{txt}', GLOB_BRACE); $i = 3; $j = 0; foreach ($images as $pic) { $i++; $j++; if ($i >= 3) { print "<div class=\"row\">"; $i = 0; } echo "<div class = \"col-sm-6 col-md-4 col-lg-4\">\n <div class = \"thumbnail\" style=\"margin-top:60px;\">\n <a href=\"../architects/architect.php?id=" . str_replace(".txt", "", str_replace($imagesDir, "", $pic)) . "\">\n <img style=\"margin-bottom:-20px;\" src=\"" . $imagesDir . getPicture(str_replace($imagesDir, "", str_replace(".txt", "", $pic)), false) . "\" alt = \"\">\n </div>\n\n <div class = \"caption\">\n <h3>" . str_replace("_", " ", str_replace(".txt", "", str_replace($imagesDir, "", $pic))) . "</a></h3>\n </div>\n </div>"; if ($j >= 3) { echo "</div>"; $j = 0; } } if (i > 0) { echo "</div>"; } ?> </div> </div> </div>
<ol class="breadcrumb"> <li><a href="../index.php">Home</a></li> <li class="active"><?php echo str_replace("_", " ", $_GET['id']); ?> </li> </ol> </div> </div> <!-- /.row --> <!-- Portfolio Item Row --> <div class="row"> <div class="col-md-8"> <img class="img-responsive" src="../pictures/Gallery/<?php echo getPicture($_GET['id'], true); ?> " alt=""> </div> <div class="col-md-4"> <h3><?php echo str_replace("_", " ", $_GET['id']); ?> </h3> <p><?php echo findFile($_GET['id'], true); ?> </p> </div> </div>
<ol class="breadcrumb"> <li><a href="../index.php">Home</a></li> <li class="active"><?php echo str_replace("_", " ", $_GET['id']); ?> </li> </ol> </div> </div> <!-- /.row --> <!-- Portfolio Item Row --> <div class="row"> <div class="col-md-4"> <img style="margin: 0 auto;" class="img-responsive" src="../pictures/Architects/<?php echo getPicture($_GET['id'], false); ?> " alt=""> </div> <div class="col-md-8" align="justify"> <h1 style="text-align:center;"><u><b><?php echo str_replace("_", " ", $_GET['id']); ?> <b></u></h1> <p><h3><?php echo findFile($_GET['id'], false); ?> </h3></p> </div> </div>
$rt = mysql_query($query); $row = mysql_fetch_assoc($rt); $where = $row['company_id'] != 0 && ($row['company_admin'] >= '1' || $row['company_confirm']) ? " or (" . LOVE . ".company_id = '" . $row['company_id'] . "' AND " . LOVE . ".private=0)" : ''; $rt = mysql_query("select count(*) from " . LOVE); $row = mysql_fetch_row($rt); $loves = $row[0]; $query = "select count(*) from " . LOVE . " where " . LOVE . ".receiver = '{$username}' or " . LOVE . ".giver = '{$username}' " . $where . " order by id desc"; $rt = mysql_query($query); $row = mysql_fetch_row($rt); $count = $row[0]; $cPages = ceil($count / $limit); $query = "select id,giver,receiver,why,private,TIMESTAMPDIFF(SECOND,at,NOW()) as delta from " . LOVE . " where " . LOVE . ".receiver = '{$username}' or " . LOVE . ".giver = '{$username}' " . $where . " order by id desc"; $query .= " LIMIT " . ($page - 1) * $limit . ",{$limit}"; $rt = mysql_query($query); // Construct json for history $history = array(array($page, $cPages, number_format($loves))); for ($i = 1; $row = mysql_fetch_assoc($rt); $i++) { $givernickname = getNickName($row['giver']); $givernickname = !empty($givernickname) ? $givernickname : $row['giver']; $receivernickname = getNickName($row['receiver']); $receivernickname = !empty($receivernickname) ? $receivernickname : $row['receiver']; $giverPicture = getPicture($row['giver']); $receiverPicture = getPicture($row['receiver']); $why = $row['why']; if ($row['private']) { $why .= " (love sent quietly)"; } $history[] = array($row['id'], $row['giver'], $givernickname, $row['receiver'], $receivernickname, $why, $row['delta'], $giverPicture, $receiverPicture); } $json = json_encode($history); echo $json;