public function listDemos(Paging $paging){ while($row = mysql_fetch_assoc($paging->pagingResult)){ if($row['rowid']==$_GET['demo_id']) continue; // Got to make a new query beacuse of error in mysql_fetch_assoc $query = new Query($this->q->getTable()); $query->whereLeftJoinImageQuery("*","image_id",$row['image_id'],"rowid","ASC"); $image_id = $query->getResultRow("image_id"); $file_name=$query->getResultRow("file"); ?> <table border="0" cellpadding="0" cellspacing="0" class="demoTable"> <tr> <?php if(Helper::hasValue($image_id)){ ?> <td width="80" class="noPadding" rowspan="2"><img src="image_crop.php?source=<?php echo Settings::getUploadedImages().'/'.$file_name ?>&dest=&thumb_size=80" class="flowPic" /></td> <?php } ?> <td width="270" class="tdPadding" colspan="2"><span class="boldGrey"><?php echo $row['name']; ?></span></td> </tr> <tr> <td class="tdVertBottom"><span class="smallPink"><a href="?demo_id=<?php echo $row['rowid']; ?>">Läs mer</a></span></td> <td align="right" class="tdVertBottom"><span class="smallGrey"><?php echo date("Y-m-d",strtotime($row['date'])); ?></span></td> </tr> </table> <? } }
public function listReviews(Paging $paging) { while ($row = mysql_fetch_assoc($paging->pagingResult)) { if ($row['rowid'] == $_GET['id'] && isset($_GET['id']) && $_GET['id'] != "") { continue; } // Got to make a new query beacuse of error in mysql_fetch_assoc $query = new Query($this->q->getTable()); $query->whereLeftJoinImageQuery("*", "image_id", $row['image_id'], "rowid", "ASC"); $image_id = $query->getResultRow("image_id"); $file_name = $query->getResultRow("file"); echo '<div class="reviewFlow">'; if (Helper::hasValue($image_id)) { echo '<a href="?id=' . $row['rowid'] . '">'; echo '<img src="image_crop.php?source=' . Settings::getUploadedImages() . '/' . $file_name . '&dest=&thumb_size=100" alt="' . $row['name'] . '" class="img"/>'; echo '</a>'; } echo '<div class="title">'; echo '<a href="?id=' . $row['rowid'] . '">'; echo $row["title"]; echo '</a>'; echo '</div>'; echo '<div class="description">'; echo '<a href="?id=' . $row['rowid'] . '">'; echo $row['description']; echo '</a>'; echo '</div>'; echo '<div class="date">'; echo '<span class="smallBlack">'; echo date("Y-m-d", strtotime($row['date'])); echo '</span>'; echo '</div>'; echo '</div>'; } }
static function displayImage($filename, $width, $class, $alt) { $size = getimagesize(Settings::getUploadedImages() . "/" . $filename); if ($size[0] > $width) { return '<img src="' . Settings::getUploadedImages() . "/" . $filename . '" alt="' . $alt . '" class="' . $class . '" width="' . $width . '"/>'; } else { return '<img src="' . Settings::getUploadedImages() . "/" . $filename . '" alt="' . $alt . '" class="' . $class . '" />'; } }
static function displayImage($filename, $width, $class, $alt) { /** Some servers **/ //$size = getimagesize($_SERVER['DOCUMENT_ROOT']."/".Settings::getUploadedImages()."/".$filename); $size = getimagesize(Settings::getUploadedImages() . "/" . $filename); if ($size[0] > $width) { return '<img src="' . Settings::getUploadedImages() . "/" . $filename . '" alt="' . $alt . '" class="' . $class . '" width="' . $width . '"/>'; } else { return '<img src="' . Settings::getUploadedImages() . "/" . $filename . '" alt="' . $alt . '" class="' . $class . '" />'; } }
public function field($class) { $ret = '<h4>' . $this->description . '</h4>'; $ret .= '<span id="imageShow" limit="' . $this->optional . '" maxWidth="200">' . "\n"; for ($i = 0; $i < count($this->value); $i++) { $ret .= '<span id="' . $this->value[$i] . '">' . "\n"; $ret .= '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . "/" . $this->value[$i] . '&width=200" />' . "\n"; $ret .= '<a href="#" removeImageId="' . $this->value[$i] . '" >' . "\n"; $ret .= '<img src="graphics/minus.jpg" width="10" border="0" alt="Ta bort"/>' . "\n"; $ret .= '</a>' . "\n"; $ret .= '<input type="hidden" name="imageArray[]" id="' . $this->value[$i] . '" value="' . $this->value[$i] . '" />' . "\n"; $ret .= '</span>' . "\n"; } $ret .= '</span> <br/>' . "\n"; return $ret; }
public function createNews(Paging $paging) { while ($row = mysql_fetch_assoc($paging->pagingResult)) { ?> <h2><?php echo $row['title']; ?> </h2> <?php echo $row['date'] . "<br />"; echo $row['image_id'] . "<br />"; if (Helper::hasValue($row['image_id'])) { echo '<img src="phpThumb.php/100;' . Settings::getUploadedImages() . '/' . $row['file'] . '" alt="' . $row['name'] . '" />'; } echo "<br />" . $row['description']; ?> <br /> <?php } }
<span id="imageShow" limit="1" maxWidth="250"></span> <br/> </div> <h2>Befintliga banners</h2> <?php $rightBannerQ = new Query("banners"); $rightBannerQ->whereLeftJoinImageQuery("*", "category", "right", "order_no", "ASC", 1); while ($row = mysql_fetch_assoc($rightBannerQ->getResult())) { echo "Ordningsnummer: " . $row['order_no'] . "<br />"; if (trim($row['bannersCode']) == "") { ?> <a href="admin_banners_edit.php?category=right&id=<?php echo $row['rowid']; ?> "><img src="<?php echo "../" . Settings::getUploadedImages() . '/' . $row['file']; ?> " width="250" /></a> <a href="admin_banners_action.php?category=right&action=remove&id=<?php echo $row['rowid']; ?> "><img src="graphics/remove.jpg" alt="Ta bort" width="10" border="0"/></a> <br /> <?php } else { echo $row['bannersCode']; echo '<a href="admin_banners_edit.php?category=right&id=' . $row['rowid'] . '">Ändra</a> '; echo '<a href="admin_banners_action.php?category=right&action=remove&id=' . $row['rowid'] . '"><img src="graphics/remove.jpg" alt="Ta bort" width="10" border="0"/></a><br />'; } } ?>
public function showActual() { $id = (int) $_GET['id']; if (Helper::givesResult($this->table, "rowid", $id)) { $q = new Query($this->table); $q->whereLeftJoinImageQuery("*", "rowid", $id, "rowid", "DESC"); $personal = new Query("personal"); $personal->whereQuery("*", "username", $q->getResultRow("published_by"), "rowid", "ASC", "1"); ?> <div class="newsHeader"><span class="dateAuthor"> <?php echo date("Y-m-d", strtotime($q->getResultRow("date"))) . ' ' . $personal->getResultRow("first_name") . ' ' . $personal->getResultRow("last_name"); ?> </span><br /><br /> <span class="newsHeaderFont"><?php echo $q->getResultRow("title"); ?> </span> </div> <div class="newsDescActual"><span class="boldGrey"><?php echo nl2br(strip_tags($q->getResultRow("description"), '<a><b><br><strong>')); ?> </span></div> <div class="newsPicActual"> <?php if ($q->getResultRow("image_id") > 0) { ?> <table><tr><td> <?php echo '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . '/' . $q->getResultRow("file") . '&width=340" alt="' . $q->getResultRow("name") . '" />'; ?> </td> </tr> <tr> <td align="right" class="smallGrey2"> <?php if ($q->getResultRow("photo") != "") { echo '<span class="smallGrey">Foto: ' . $q->getResultRow("photo") . '</span>'; } ?> </td> </tr> </table> <?php } ?> </div> <?php echo nl2br(strip_tags($q->getResultRow("text"), '<a><b><br><strong>')); ?> <br /><br /> <?php } }
</div> <div id="centerContainer"> <?php $newest = new Query("new"); $newest->whereAndLeftJoinImageQuery("*", "active", 1, "date", "DESC"); if ($newest->getNumRows() > 0) { ?> <div class="newestHeaderBig"></div> <div class="newestBig"> <table border="0" cellpadding="0" cellspacing="0" class="noBorder"> <tr> <td width="80" class="noPadding" rowspan="3"><a href="index.php?id=<?php echo $newest->getResultRow("rowid"); ?> "><img src="image_crop.php?source=<?php echo Settings::getUploadedImages() . '/' . $newest->getResultRow("file"); ?> &dest=&thumb_size=100" class="imgWhiteBorder" /></a></td> <td width="450" class="tdPadding" colspan="2"><span class="boldWhite"><a href="index.php?id=<?php echo $newest->getResultRow("rowid"); ?> "><?php echo $newest->getResultRow("title"); ?> </a></span></td> </tr> <tr> <td class="tdPadding" colspan="2"><span class="smallWhite"><a href="index.php?id=<?php echo $newest->getResultRow("rowid"); ?> "><?php
echo '<a href="shop.php"><img src="graphics/menuItems/butik.png" border="0" class="menuItem" /></a>'; echo '<a href="prenumeration.php"><img src="graphics/menuItems/prenumeration.png" border="0" class="menuItem" /></a>'; echo '<a href="letter.php"><img src="graphics/menuItems/letter.png" border="0" class="menuItem"/></a>'; echo '<a href="about.php"><img src="graphics/menuItems/om.png" border="0" class="menuItem"/></a>'; echo '<a href="announce.php"><img src="graphics/menuItems/annonsera.png" border="0" class="menuItem" /></a>'; echo '</div>'; echo '</div>'; echo '</div>'; //topDiv echo '<div id="leftDiv">'; $query = "SELECT * FROM monthly_magazine\n\t\tLEFT JOIN bilder\n\t\tON monthly_magazine.image_id = bilder.id\n\t\tWHERE active='1' AND image_id > '0' \n\t\tORDER BY number DESC\n\t\tLIMIT 0, 1"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) > 0) { echo '<div id="monthlyMag">'; echo '<a href="number.php?id=' . mysql_result($result, 0, "rowid") . '">'; echo '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . '/' . mysql_result($result, 0, "file") . '&width=148" class="imgWhiteBorder"/>'; echo '</a>'; echo '</div>'; } echo '<div id="shop">'; echo '<div class="shopBg"></div>'; echo '<div class="shopCenter">'; echo '<span class="smallWhite">'; echo '<a href="shop2.php">'; echo 'Köp exklusiva OPUS-prylar, tidigare utgåvor, utvalda cd & dvd, t-shirts mm. Här hittar du julklappar och presenter för hela året!'; echo '</a>'; echo '</span>'; echo '<span class="boldWhite">'; echo '</span>'; echo '</div>'; echo '</div>';
<?php include "header_inc.php"; echo '<div id="centerDiv">'; echo '<div class="newsBg">'; echo '<div class="newsHeaderActual">'; echo '<span class="newsHeaderFont">'; echo 'Skribenterna på OPUS'; echo '</span>'; echo '</div>'; echo '<br />'; if (Helper::isInt($_GET['id']) && Helper::hasValue($_GET['id']) && Helper::givesResult("personal", "rowid", $_GET['id'])) { $query = new Query("personal"); $query->whereLeftJoinImageQuery("*", "rowid", $_GET['id'], "last_name", "DESC"); if (Helper::hasValue($query->getResultRow("image_id"))) { echo '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . '/' . $query->getResultRow("file") . '&width=200" />'; } echo '<br />'; echo '<br />'; echo '<p>'; echo '<strong>'; echo $query->getResultRow("first_name") . " " . $query->getResultRow("last_name"); echo '</strong>'; echo '</p>'; echo '<br />'; echo '<p>'; echo '<strong>'; echo 'Bäst just nu'; echo '</strong>'; echo '</p>'; echo '<ul style="list-style:decimal; margin-left:20px";>';
/** * Listar alla på förstasidan, dvs level=0 */ private function showTable2($class) { $q = new Query("matruschka"); $q->whereQuery("*", "mLevel", 0, "mLang", "DESC", 0); echo '<br/><br/>'; echo '<table class="' . $class . '" cellpadding="0" cellspacing="0">' . "\n"; echo '<th> </th>'; echo '<th>Title</th>'; echo '<th>Sub cat´s</th>'; echo '<th>Show style</th>'; echo '<th>Order no.</th>'; echo '<th>Lang</th>'; echo '<th>Published</th>'; //echo '<th align="left">Publiceringsdatum</th>'; //echo '<th align="left">Senast uppdaterad</th>'; //echo '<th align="left">Adminlevel</th>'; echo '<th> </th>'; echo '<th> </th>'; $i = 0; while ($row = mysql_fetch_object($q->getResult())) { $ssThumb; $imgQ = new Query("matruschkaImages"); $imgQ->whereQuery('*', 'miMatruschkaID', $row->mRowid, 'miMatruschkaID', 'DESC', 2); $img = $imgQ->getResultRow('miFilename'); if ($row->mShowStyle == "ImageShow") { $ssThumb = AdminImageShow::$thumbnail; } elseif ($row->mShowStyle == "TextShow") { $ssThumb = AdminTextShow::$thumbnail; } elseif ($row->mShowStyle == "ImageShow2") { $ssThumb = AdminImageShow2::$thumbnail; } elseif ($row->mShowStyle == "Agree") { $ssThumb = AdminAgree::$thumbnail; } elseif ($row->mShowStyle == "Start") { $ssThumb = AdminStart::$thumbnail; } // Fyll på med fler echo "<tr>\n"; echo '<td class="td' . $i . '"><img src="image_crop.php?source=' . Settings::getUploadedImages() . '/' . $img . '&dest=&thumb_size=40" /></td>' . "\n"; echo '<td class="td' . $i . '">'; if ($_SESSION['admin_level'] >= $row->mAdminLevel || $_SESSION['admin_logged'] == $row->mAuthor) { echo '<a href="?ID=' . $row->mRowid . '">'; echo $row->mButtonTitle ? $row->mButtonTitle : $row->mTitle; echo '</a>'; } else { echo $row->mButtonTitle ? $row->mButtonTitle : $row->mTitle; } echo "</td>\n"; echo '<td class="td' . $i . '">'; $subQ = new Query("matruschka"); $subQ->whereQuery("mRowid", "mParent", $row->mRowid, "mRowid", "ASC", 0); echo $subQ->getNumRows(); echo "</td>\n"; echo "<td valign=\"bottom\" class=\"td{$i}\">"; echo "<span onclick=\"MM_openBrWindow('" . Settings::$customGraphics . $ssThumb . "','Preview','width=500,height=500')\" style=\"cursor: hand; cursor: pointer;\">"; echo $row->mShowStyle; echo '</span>'; echo "</td>\n"; echo '<td class="td' . $i . '">' . $row->mOrderNo . '</td>' . "\n"; echo '<td class="td' . $i . '">' . $row->mLang . '</td>' . "\n"; echo '<td class="td' . $i . '">'; echo $row->mPublished ? '<span style="color:#339900">Yes</span>' : '<span style="color:#FF0000">No</span>'; echo "</td>\n"; //echo '<td valign="bottom">'.$row->mPubDate.'</td>'."\n"; //echo '<td valign="bottom">'.$row->mUpdateDate.'</td>'."\n"; //echo '<td valign="bottom">'.$row->mAdminLevel.'</td>'."\n"; echo '<td class="td' . $i . '">'; if ($_SESSION['admin_level'] >= $row->mAdminLevel || $_SESSION['admin_logged'] == $row->mAuthor) { echo '<a href="?ID=' . $row->mRowid . '">Edit</a>'; } else { echo ' '; } echo '</td>' . "\n"; echo '<td class="td' . $i . '">'; if ($_SESSION['admin_level'] >= $row->mAdminLevel || $_SESSION['admin_logged'] == $row->mAuthor) { echo '<a href="?action=Remove&mID=' . $row->mRowid . '&ID=' . $this->ID . '" name="removeButton">Remove</a>'; } else { echo ' '; } echo '</td>' . "\n"; echo '</tr>' . "\n"; $i++; $i = $i % 2; } echo '</table>'; }
<div id="centerDivBig"> <?php $id = (int) $_GET['id']; if (Helper::givesResult("monthly_magazine", "rowid", $id) && Helper::isInt($id)) { $query = "SELECT * FROM monthly_magazine\n\t\t\tLEFT JOIN bilder\n\t\t\tON monthly_magazine.crossword=bilder.id\n\t\t\tWHERE rowid = " . $_GET['id'] . ""; $result = mysql_query($query) or die(mysql_error()); ?> <div class="newsHeader"> <span class="newsHeaderSmaller"><p>#<?php echo mysql_result($result, 0, "number"); ?> </p></span> </div> <div class="newsPicActual"> <?php echo '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . '/' . mysql_result($result, 0, "file") . '&width=512" alt="#' . mysql_result($result, 0, "number") . ' lösning"/>'; ?> </div> <?php } ?> <br/> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <?php $query = new Query(monthly_magazine); $query->whereCustom("*", "crossword > 0", "number", "DESC", 1000); $paging = new Paging($query, 30); $paging->whereCustom(); while ($row = mysql_fetch_assoc($paging->getResult())) {
public function showImage($width) { return '<img src="image_thumb.php?source=' . Settings::getUploadedImages() . '/' . $this->q->getResultRow("file") . '&width=' . $width . '" alt="' . $this->q->getResultRow("name") . '"/>'; }