function getCat($ul, $parent = null) { global $count_success; //$nodes = $ul->getElementsByTagName('ul'); $li = $ul->firstChild; $count = 0; while ($li) { $parent = str_replace("/", "-", $parent); if ($li->nodeType !== 1) { $li = $li->nextSibling; continue; } $link = $li->getElementsByTagName('a'); //$span = $link->item(0)->getElementsByTagName('span'); $cat_name = $link->item(0)->nodeValue; $ulnode = $li->getElementsByTagName('ul'); //$ulnode = $ulnode->item(0); $cat_name = str_replace("/", "-", $cat_name); cat_to_csv($parent, $cat_name); if ($ulnode->length > 0) { echo $parent . ' -> ' . $cat_name . '<br />'; $depth = $ulnode->item(0)->getElementsByTagName('ul'); for ($i = 0; $i < $ulnode->length; $i++) { if ($ulnode->item($i)->getElementsByTagName('ul')->length === $depth->length) { getCat($ulnode->item($i), $cat_name); $depth = $ulnode->item($i)->getElementsByTagName('ul'); } } } else { echo $parent . ' -> ' . $cat_name . '<br />'; $enlace = $link->item(0)->getAttribute('href'); //$enlace = substr_replace($enlace,'s',4,0); file_put_contents("../file/cats_list.ccd", $enlace . PHP_EOL, FILE_APPEND); //var_dump($li->parentNode); echo $enlace . '<br />'; } $li = $li->nextSibling; //$li = /* while($temp->childNodes ==null){ $temp = $temp->nextSibling; } $li = $temp;*/ $count_success++; } }
function getCat($where) { $result = simpleSelect($GLOBALS['select'], $GLOBALS['tableName'], NULL, NULL, $where, NULL, NULL, $GLOBALS['conn']); $data = array(); if (is_null($result)) { return NULL; } else { while ($row = $result->fetch_assoc()) { $subCats = getCat("parentid = '" . $row['id'] . "'"); if ($subCats) { $data[] = array_merge($row, array("subCategories" => $subCats)); } else { $data[] = $row; } } return $data; } }
function getCat($where, $conn, $lang, $langArr) { $selQ = new selectSQL($conn); if (!empty($lang)) { $selQ->select = array("id", "parentid", "name" . $lang . " as nameEN", "desc" . $lang . " as descEN", "imgurl"); } else { $selQ->select = array("id", "parentid"); foreach ($langArr as $l) { $selQ->select[] = "name" . $l; $selQ->select[] = "desc" . $l; } $selQ->select[] = "imgurl"; } $selQ->tableNames = array("categories"); $selQ->where = $where; if (isset($_POST['deleted'])) { $selQ->where .= " AND visible = 0"; } else { $selQ->where .= " AND visible = 1"; } if (!$selQ->executeQuery()) { return; } if ($selQ->getNumberOfResults() > 0) { while ($row = $selQ->result->fetch_assoc()) { $subCats = getCat("parentid = '" . $row['id'] . "'", $conn, $lang, $langArr); if ($subCats) { $data[] = array_merge($row, array("subCategories" => $subCats)); } else { $data[] = $row; } } return $data; } else { return; } }
<span class="autor">Por: <strong><?php echo $autor['nome']; ?> </strong></span> <span class="data">dia: <strong><?php echo date('d/m/Y H:i:s', strtotime($art['data'])); ?> </strong></span> <span class="cat">em: <a href="<?php setHome(); ?> /categoria/<?php echo getCat($art['categoria'], 'url'); ?> "><?php echo getCat($art['categoria'], 'nome'); ?> </a></span> <span class="tags"><?php echo $art['tags']; ?> </span> <span class="views"><?php echo $art['visitas']; ?> </span> </div><!-- /metadata --> </div><!-- // content --> <div class="sidebar">
echo '<section class="span8">'; if ($message) { echo '<span class="alert alert-error span8">Esse Produto já possui este campo cadastrado! Edite abaixo se desejar ou delete! </span>'; } echo '<span class="alert alert-info span8">Clique nos Botões para adicionar mais campos :</span>'; echo '<a href="index2.php?exe=posts/posts-measures&editid=' . $postedit['id'] . '" title="Artigos" class="btn btn-danger">Medidas</a>'; echo '<a href="index2.php?exe=posts/posts-pagers&editid=' . $postedit['id'] . '" title="Artigos" class="btn btn-danger">Páginas</a>'; echo '<a href="index2.php?exe=posts/posts-papers&editid=' . $postedit['id'] . '" title="Artigos" class="btn btn-danger">Tipo de Papel</a>'; echo '<a href="index2.php?exe=posts/posts-colors&editid=' . $postedit['id'] . '" title="Artigos" class="btn btn-danger">Cores</a>'; echo '<a href="index2.php?exe=posts/posts" title="Listar Produtos" class="pull-right btn btn-primary">Listar Produtos</a>'; if (isset($_POST['sendForm'])) { $f['titulo'] = htmlspecialchars(mysql_real_escape_string($_POST['titulo'])); $f['content'] = mysql_real_escape_string($_POST['content']); $f['date'] = htmlspecialchars(mysql_real_escape_string($_POST['data'])); $f['cat_id'] = htmlspecialchars(mysql_real_escape_string($_POST['categoria'])); $f['cat_pai'] = getCat($f['cat_id'], 'id_pai'); $f['nivel'] = htmlspecialchars(mysql_real_escape_string($_POST['nivel'])); $f['status'] = $_POST['sendForm'] == 'Salvar' ? '0' : '1'; $f['autor'] = $_SESSION['autUser']['id']; $f['tipo'] = 'post'; if (in_array('', $f)) { echo '<span class="alert alert-info">Informe todos os Campos!</span>'; } else { if (!empty($_POST['paginas'])) { $g['post_id'] = $postedit['id']; $g['paginas'] = htmlspecialchars(mysql_real_escape_string($_POST['paginas'])); update('pagers', $g, "post_id = '{$urledit}' "); } if (!empty($_POST['medidas'])) { $h['post_id'] = $postedit['id']; $h['measure'] = htmlspecialchars(mysql_real_escape_string($_POST['medidas']));
header('Location: index2.php'); } else { ?> <div class="bloco form" style="display:block"> <div class="titulo"> Cadastrar novo artigo: <a href="index2.php?exe=posts/posts" title="Artigos" class="btnalt" style="float: right">Listar Artigos</a> </div> <?php if (isset($_POST['sendForm'])) { $f['titulo'] = htmlspecialchars(mysql_real_escape_string($_POST['titulo'])); $f['tags'] = htmlspecialchars(mysql_real_escape_string($_POST['tags'])); $f['content'] = mysql_real_escape_string($_POST['content']); $f['date'] = htmlspecialchars(mysql_real_escape_string($_POST['data'])); $f['categoria'] = htmlspecialchars(mysql_real_escape_string($_POST['categoria'])); $f['cat_pai'] = getCat($f['categoria'], 'id_pai'); $f['nivel'] = htmlspecialchars(mysql_real_escape_string($_POST['nivel'])); $f['status'] = $_POST['sendForm'] == 'Salvar' ? '0' : '1'; $f['autor'] = $_SESSION['autUser']['id']; $f['tipo'] = 'post'; if (in_array('', $f)) { echo '<span class="ms in">Para uma boa alimentação, informe todos os campos!</span>'; } else { $f['data'] = formDate($f['date']); unset($f['date']); $f['url'] = setUri($f['titulo']); $readPostUri = read('up_posts', "WHERE url LIKE '%{$f['url']}%'"); if ($readPostUri) { $f['url'] = $f['url'] . '-' . count($readPostUri); $readPostUri = read('up_posts', "WHERE url = '{$f['url']}'"); if ($readPostUri) {
echo '<table width="560" border="0" class="tbdados" style="float:left;" cellspacing="0" cellpadding="0"> <tr class="ses"> <td>titulo:</td> <td align="center">data:</td> <td align="center">categoria:</td> <td align="center">visitas:</td> <td align="center" colspan="4">ações:</td> </tr>'; foreach ($readArt as $art) { $views = $art['visitas'] != '' ? $art['visitas'] : '0'; $stIco = $art['status'] == '0' ? 'alert.png' : 'ok.png'; $stSta = $art['status'] == '0' ? 'ativar' : 'inativar'; echo '<tr>'; echo '<td><a href="' . BASE . '/artigo/' . $art['url'] . '" title="' . $art['titulo'] . '" target="_blank">' . lmWord($art['titulo'], 30) . '</a></td>'; echo '<td align="center">' . date('d/m/y H:i', strtotime($art['titulo'])) . '</td>'; echo '<td align="center"><a target="_blank" href="' . BASE . '/categoria/' . getCat($art['categoria'], 'url') . '" title="' . getCat($art['categoria'], 'url') . '">' . getCat($art['categoria'], 'nome') . '</a></td>'; echo '<td align="center">' . $views . '</td>'; echo '<td align="center"><a href="index2.php?exe=posts/posts-edit&editid=' . $art['id'] . '" title="editar"><img src="ico/edit.png" alt="editar" title="editar" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=posts/gallery&postid=' . $art['id'] . '" title="postar galeria"><img src= "ico/gb.png" alt="postar galeria" title="postar galeria" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=posts/posts&pag=' . $pag . '&sts=' . $art['status'] . '&id=' . $art['id'] . '" title="' . $stSta . '"><img src="ico/' . $stIco . '" alt="' . $stSta . '" title="' . $stSta . '" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=posts/posts&pag=' . $pag . '&delid=' . $art['id'] . '&thumb=' . $art['thumb'] . '" title="excluir"><img src="ico/no.png" alt="excluir" title="excluir" /></a></td>'; echo '</tr>'; } echo '</table>'; $link = 'index2.php?exe=posts/posts&pag='; readPaginator('up_posts', "WHERE tipo = 'post'{$_SESSION[where]} ORDER BY data DESC", $maximo, $link, $pag); } ?> <!--<div class="paginator"> <a href="#">primeira</a> <span class="selected">1</span> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">5</a>
function generateGoogle() { date_default_timezone_set("America/Denver"); //include( plugin_dir_path( __FILE__ ) . 'functions.php'); global $woocommerce, $product, $post, $re_wcvt_options, $xml; $args = array('post_type' => 'product', 'posts_per_page' => -1); $loop = new WP_Query($args); $xml = new DOMDocument('1.0', 'UTF-8'); $xml->formatOutput = true; $rss = $xml->createElement("rss"); $rss_node = $xml->appendChild($rss); //add RSS element to XML node $rss_node->setAttribute("version", "2.0"); //set RSS version $rss_node->setAttribute("xmlns:atom", "http://www.w3.org/2005/Atom"); $rss_node->setAttribute("xmlns:g", "http://base.google.com/ns/1.0"); $currentItem = $xml->createElement("channel"); $currentItem = $rss_node->appendChild($currentItem); $currentItem->appendChild($xml->createElement('title', 'Novosbed')); $buildLinks = $xml->createElement('link'); $buildLinks = $currentItem->appendChild($buildLinks); $buildLinks->appendChild($xml->createCDATASection('http://wwww.novosbed.com')); $currentItem->appendChild($xml->createElement('description', '----------------------------------------------')); while ($loop->have_posts()) { $loop->the_post(); global $product; $product = get_product($loop->post); $attributes = $product->get_attributes(); //print_r($product); // Debug option make sure is commented out live //print_r($attributes); //checks if product is in stock and visable to public. if ($product->is_in_stock() && $product->is_visible()) { /* append it to the document created */ // Checks if product has sizes (twin/twin XL.. etc) if ($product->has_child()) { // Loops through products and gets variation attriubtes (sku/weight/etc) $ProdVar = $product->get_available_variations(); foreach ($ProdVar as $Variation) { $buildItem = $xml->createElement("item"); $buildItem = $currentItem->appendChild($buildItem); $buildItem->appendChild($xml->createElement('g:title', ucfirst(get_the_title()) . ' ' . ucfirst($Variation['attributes']['attribute_pa_firmness']))); // This is not working yet $buildLink = $xml->createElement('g:link'); $buildLink = $buildItem->appendChild($buildLink); $buildLink->appendChild($xml->createCDATASection(ucfirst(get_permalink()))); $buildItem->appendChild($xml->createElement('g:type', ucfirst(getGType()))); $buildCat = $xml->createElement('g:google_product_catergory'); $buildCat = $buildItem->appendChild($buildCat); $buildCat->appendChild($xml->createCDATASection(getCat())); $buildItem->appendChild($xml->createElement('g:brand', brand())); $buildItem->appendChild($xml->createElement('g:availablility', 'In Stock')); $buildItem->appendChild($xml->createElement('g:condition', 'New')); //Add shipping branch $buildShipping = $xml->createElement("g:shipping"); $buildShipping = $buildItem->appendChild($buildShipping); $buildShipping->appendChild($xml->createElement('g:country', 'US')); $buildShipping->appendChild($xml->createElement('g:service', 'FedEx Ground')); $buildShipping->appendChild($xml->createElement('g:price', '0.00 USD')); //Back to Item $buildItem->appendChild($xml->createElement('g:ID', $Variation['sku'])); // loop multi dimensional array to get size $buildItem->appendChild($xml->createElement('g:size', ucfirst($Variation['attributes']['attribute_pa_size']))); $buildItem->appendChild($xml->createElement('g:price', '$' . strip_tags($Variation['display_price'] . ' USD'))); // Strips 'lbs' from weight retrived even if empty variable $weight = str_replace(array(' ', 'l', 'b', 's'), '', $Variation['weight']); if (!empty($weight)) { // if number remains print weight + lbs $buildItem->appendChild($xml->createElement('g:weight', $weight . ' lbs')); } if (!empty($Variation['dimensions'])) { // if product has data in dimensions will echo $buildItem->appendChild($xml->createElement('g:dimensions', $Variation['dimensions'])); } $buildDesc = $xml->createElement('g:description'); $buildDesc = $buildItem->appendChild($buildDesc); $buildDesc->appendChild($xml->createCDATASection(strip_tags($Variation['variation_description']))); //print_r($Variation); // Debug option make sure is commented out live // loops through gallry image items and retrives file path. if (metadata_exists('post', $post->ID, '_product_feed_gallery')) { $product_image_gallery = get_post_meta($post->ID, '_product_feed_gallery', true); $attachments = array_filter(explode(',', $product_image_gallery)); if ($attachments) { $i = 0; foreach ($attachments as $attachment_id) { $image_link = wp_get_attachment_url($attachment_id); if ($i < 1) { $buildImage = $xml->createElement('g:image'); $buildImage = $buildItem->appendChild($buildImage); $buildImage->appendChild($xml->createCDATASection($image_link)); $i++; } else { $buildAddImage = $xml->createElement('g:additional_image'); $buildAddImage = $buildItem->appendChild($buildAddImage); $buildAddImage->appendChild($xml->createCDATASection($image_link)); $i++; } } } } // end foreach// end foreach $buildItem->appendChild($xml->createElement('g:mpn', $Variation['sku'])); } } //echo '<br>'; } // Loop trough rest of products available that have no sizes. //checks for products with no child objects and is visable if (!$product->has_child() && $product->is_visible()) { $buildItem = $xml->createElement("item"); $buildItem = $currentItem->appendChild($buildItem); $buildItem->appendChild($xml->createElement('g:title', get_the_title())); // This is not working yet $buildLink = $xml->createElement('g:link'); $buildLink = $buildItem->appendChild($buildLink); $buildLink->appendChild($xml->createCDATASection(ucfirst(get_permalink()))); $buildItem->appendChild($xml->createElement('g:type', getGType())); $buildCat = $xml->createElement('g:google_product_catergory'); $buildCat = $buildItem->appendChild($buildCat); $buildCat->appendChild($xml->createCDATASection(getCat())); $buildItem->appendChild($xml->createElement('g:brand', brand())); $buildItem->appendChild($xml->createElement('g:availablility', 'In Stock')); $buildItem->appendChild($xml->createElement('g:condition', 'New')); //Add shipping branch $buildShipping = $xml->createElement("g:shipping"); $buildShipping = $buildItem->appendChild($buildShipping); $buildShipping->appendChild($xml->createElement('g:country', 'US')); $buildShipping->appendChild($xml->createElement('g:service', 'FedEx Ground')); $buildShipping->appendChild($xml->createElement('g:price', '0.00 USD')); //Back to Item $buildItem->appendChild($xml->createElement('g:ID', $product->sku)); //$buildItem->appendChild($xml->createElement('g:size', ucfirst($Variation['attributes']['attribute_pa_size']))); $buildItem->appendChild($xml->createElement('g:price', '$' . $product->price . ' USD')); // Strips 'lbs' from weight retrived even if empty variable $weight = str_replace(array(' ', 'l', 'b', 's'), '', $product->weight); if (!empty($weight)) { // if number remains print weight + lbs $buildItem->appendChild($xml->createElement('g:weight', $product->weight . ' lbs')); } if (!empty($product->length)) { // if product has data in dimensions will echo $buildItem->appendChild($xml->createElement('g:dimensions', $product->length . '"x' . $product->width . '"x' . $product->height . '"')); } $buildDesc = $xml->createElement('g:description'); $buildDesc = $buildItem->appendChild($buildDesc); $buildDesc->appendChild($xml->createCDATASection(strip_tags(description($post)))); if (metadata_exists('post', $post->ID, '_product_feed_gallery')) { $product_image_gallery = get_post_meta($post->ID, '_product_feed_gallery', true); $attachments = array_filter(explode(',', $product_image_gallery)); if ($attachments) { $i = 0; foreach ($attachments as $attachment_id) { $image_link = wp_get_attachment_url($attachment_id); if ($i < 1) { $buildImage = $xml->createElement('g:additional_image'); $buildImage = $buildItem->appendChild($buildImage); $buildImage->appendChild($xml->createCDATASection($image_link)); $i++; } else { $buildAddImage = $xml->createElement('g:additional_image'); $buildAddImage = $buildItem->appendChild($buildAddImage); $buildAddImage->appendChild($xml->createCDATASection($image_link)); $i++; } } } } // end foreach// end foreach $buildItem->appendChild($xml->createElement('g:mpn', $product->sku)); } } echo writeFile($xml); wp_reset_query(); }
<?php setArq('tpl/header'); ?> <div id="content"> <div class="home"> <div class="slide"> <ul> <?php $readSlide = read('(SELECT * FROM up_posts ORDER BY data DESC) up_posts', "WHERE tipo = 'post' AND status = '1' GROUP BY cat_pai ORDER BY data DESC LIMIT 4"); foreach ($readSlide as $slide) { echo '<li>'; getThumb($slide['thumb'], $slide['tags'], $slide['titulo'], '866', '254', '', '', '#', 't'); echo '<div class="info">'; echo '<p class="titulo"><a href="' . BASE . '/artigo/' . $slide['url'] . '" title="ver mais de ' . $slide['titulo'] . '">' . getCat($slide['cat_pai'], 'nome') . ' - ' . $slide['titulo'] . '</a></p>'; echo '<p class="resumo"><a href="' . BASE . '/artigo/' . $slide['url'] . '" title="ver mais de ' . $slide['titulo'] . '">' . lmWord($slide['content'], 300) . '</a></p>'; echo '</div><!-- /info -->'; echo '</li>'; } ?> </ul> <div class="slidenav"></div><!-- /slide nav--> </div><!-- /slide --> <ul class="entretenimeto"> <?php $readBloco = read('up_posts', "WHERE tipo = 'post' AND status = '1' AND cat_pai = '18' ORDER BY data DESC LIMIT 1,5"); foreach ($readBloco as $bl) { $i++; echo '<li';
<tr class="ses"> <td>titulo:</td> <td align="center">data:</td> <td align="center">categoria:</td> <td align="center">visitas:</td> <td align="center" colspan="4">ações:</td> </tr>'; foreach ($readArt as $art) { $views = $art['visitas'] != '' ? $art['visitas'] : '0'; $stIco = $art['status'] == '0' ? 'alert.png' : 'ok.png'; $stSta = $art['status'] == '0' ? 'ativar' : 'inativar'; echo '<tr>'; echo '<td><a href="' . BASE . '/artigo/' . $art['url'] . '" title="' . $art['titulo'] . '" target="_blank">' . lmWord($art['titulo'], 30) . '</a></td>'; echo '<td align="center">' . date('d/m/y H:i', strtotime($art['data'])) . '</td>'; echo '<td align="center"><a target="_blank" href="' . BASE . '/categoria/' . getCat($art['categoria'], 'url') . '" '; echo 'title="' . getCat($art['categoria'], 'url') . '">' . getCat($art['categoria'], 'nome') . '</a></td>'; echo '<td align="center">' . $views . '</td>'; echo '<td align="center"><a href="index2.php?exe=posts/posts-edit&editid=' . $art['id'] . '" title="editar">'; echo '<img src="ico/edit.png" alt="editar" title="editar" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=posts/gallery&postid=' . $art['id'] . '" title="postar galeria">'; echo '<img src="ico/gb.png" alt="postar galeria" title="postar galeria" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=posts/posts&pag=' . $pag . '&sts=' . $art['status'] . '&id=' . $art['id'] . '" '; echo 'title="' . $stSta . '"><img src="ico/' . $stIco . '" alt="' . $stSta . '" title="' . $stSta . '" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=posts/posts&pag=' . $pag . '&delid=' . $art['id'] . '&thumb=' . $art['thumb'] . '"'; echo 'title="excluir"><img src="ico/no.png" alt="excluir" title="excluir" /></a></td>'; echo '</tr>'; } echo '</table>'; $link = 'index2.php?exe=posts/posts&pag='; readPaginator('up_posts', "WHERE tipo = 'post' {$_SESSION[where]} ORDER BY data DESC", $maximo, $link, $pag); }
</div> <div id="contents"> <section class="newsArea"> <h3>NEWS<br><span>お知らせ・更新情報</span></h3> <div class="newsContent"> <dl> <?php foreach ($results as $key => $value) { ?> <dt> <?php echo date('Y年n月j日', strtotime($value["create_date"])); ?> <span class="tagCat"> <?php echo getCat($value["news_cat"]); ?> </span> </dt> <dd> <a href="news.php?news_id=<?php echo $value["news_id"]; ?> "><?php echo letter($value["news_title"], 10); ?> </a> </dd> <?php } ?>
echo '</ul><!-- //gallery -->'; } ?> <span>Postado dia: <strong><?php echo date('d/m/Y H:i:s', strtotime($art['data'])); ?> </strong></span> <span> | Em : <a href="<?php setHome(); ?> /categoria/<?php echo getCat($art['cat_id'], 'url'); ?> "><?php echo getCat($art['cat_id'], 'nome'); ?> </a></span> <span> | Visitas :<strong><?php echo $art['visitas']; ?> </strong></span> <?php } ?> </section><!-- /section span4 --> <!-----------------------------------------------------DESCRIÇÕES DO PRODUTO -----------> <section class="span3"> <h5>Descrição :</h5>
//Crée l'objet Catégorie. $resultats[] = new Categorie($categorie); } } return $resultats; } //Si on arrive à la page après le bouton submit 'valider' du formulaire a été cliqué. if (isset($_POST['valider'])) { $tabFormulaire = array(); //Le POST contient toutes les données entré par l'utilisateur dans le formulaire. //On désinfecte les données et les enregistres dans le tableau. foreach ($_POST as $cle => $valeur) { $tabFormulaire[$cle] = desinfecte($valeur); } //Obtien un tableau d'objets Catégories avec les données du POST. $resultats = getCat($tabFormulaire); //Avec le tableau de Catégories contenu dans la BD, les Catégories du POST et une fonction de comparaison //obtien un tableau contenant les catégories modifiées. $diff = array_udiff($resultats, $categories, 'compare_categories'); //Indique si une modification a eu lieu. Pour rafraichir les données lorsque la BD est à jour. $doitRafraichir = false; //flag de validation $valide = true; //Valide la longueur du champ. foreach ($resultats as $key => $value) { if (strlen($value->getNom()) < 2 || strlen($value->getNom()) > 20) { //Message d'erreur de validation. $messagesErreur[$key] = 'Le nom doit être entre 2 et 20 caractères.'; $valide = false; } }
$sql = "SELECT * FROM image WHERE id < " . $lastId . " ORDER BY id DESC LIMIT 9 "; $result = $GLOBALS['conn']->query($sql); while ($row = mysqli_fetch_assoc($result)) { $row = array('img_id' => $row['id'], 'img_tagline' => $row['tagline'], 'img_name' => $row['name'], 'img_description' => $row['description'], 'img_source_site' => $row['source_site'], 'photo_url' => $row['photo_url'], 'photo_thumb_url' => $row['photo_thumb_url'], 'img_source_url' => $row['source_url'], 'img_tags' => $row['tags'], 'img_category_name' => $row['category_name'], 'img_date_created' => $row['date_created'], 'img_date_modified' => $row['date_modified'], 'img_is_favourite' => $row['is_favourite'], 'img_user_id' => $row['user_id'], 'img_status' => $row['status']); $data[] = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $row); } echo json_encode($data); } if ($_POST['action'] == 'getImages') { getImages($_POST['startImages']); } else { if ($_POST['action'] == "getImagesSearch") { imgSearch($_POST['search']); } else { if ($_POST['action'] == "catImagesSearch") { catImagesSearch($_POST['category']); } else { if ($_POST['action'] == "getCat") { getCat(); } else { if ($_POST['action'] == "catDrop") { getCat(); } else { if ($_POST['action'] == "getMoreImages") { getMoreImages($_POST['lastId']); } } } } } }
<thead> <tr> <th>categoria:</th> <th>data:</th> <th>nome do produto:</th> <th>visitas:</th> <th colspan="4">ações:</th> </tr> </thead><tbody>'; foreach ($readArt as $art) { $views = $art['visitas'] != '' ? $art['visitas'] : '0'; $setIco = $art['status'] == '0' ? 'alert.png' : 'ok.png'; $setAtv = $art['status'] == '0' ? 'ativar' : 'desativar'; echo '<tr>'; echo '<td><a target="_blank" href="' . BASE . '/produtos/' . getCat($art['cat_id'], 'url') . '" title="' . getCat($art['cat_id'], 'url') . '">' . getCat($art['cat_id'], 'nome') . '</a></td>'; echo '<td>' . date('d/m/y H:i', strtotime($art['data'])) . '</td>'; echo '<td><a href="' . BASE . '/produto/' . $art['url'] . '" title="' . $art['titulo'] . '" target="_blank">' . lmWord($art['titulo'], 30) . '</a></td>'; echo '<td>' . $views . '</td>'; echo '<td><a href="index2.php?exe=posts/posts-edit&editid=' . $art['id'] . '" title="editar"><img src="ico/edit.png" alt="editar" title="editar" /></a></td> '; echo '<td><a href="index2.php?exe=posts/gallery&postid=' . $art['id'] . '" title="postar galeria"><img src="ico/gb.png" alt="postar galeria" title="postar galeria" /></a></td>'; echo '<td><a href="index2.php?exe=posts/posts&pag=' . $pag . '&sts=' . $art['status'] . '&id=' . $art['id'] . '" title="' . $setAtv . '"><img src="ico/' . $setIco . '" alt="' . $setAtv . '" title="' . $setAtv . '" /></a></td>'; echo '<td><a href="index2.php?exe=posts/posts&pag=' . $pag . '&delid=' . $art['id'] . '&thumb=' . $art['thumb'] . '" title="excluir"><img src="ico/no.png" alt="excluir" title="excluir" /></a></td>'; echo '</tr>'; } echo '</tbody>'; echo '</table>'; $link = 'index2.php?exe=posts/posts&pag='; readPaginator('posts', " WHERE tipo = 'post' {$_SESSION[where]} ORDER BY data DESC", $maximo, $link, $pag); } ?>
<tr class="ses"> <td>titulo:</td> <td align="center">data:</td> <td align="center">categoria:</td> <td align="center">visitas:</td> <td align="center" colspan="4">ações:</td> </tr>'; foreach ($readPost as $posts) { $strIco = $posts['status'] == '0' ? 'ico/alert.png' : 'ico/ok.png'; $strStatus = $posts['status'] == '0' ? 'Ativar' : 'Desativar'; echo ' <tr>'; echo ' <td><a href="' . BASE . '/artigo/' . $posts['url'] . '" target="_blank" title="' . $posts['titulo'] . '">' . lmWords($posts['titulo'], 30) . '</a></td>'; echo ' <td align="center">' . date('d/m/y H:i:', strtotime($posts['data'])) . '</td>'; echo ' <td align="center"><a target="_blank" href="' . BASE . '/categoria/' . getCat($posts['categoria'], 'url') . '" title="' . getCat($posts['categoria'], 'url') . '">' . getCat($posts['categoria'], 'nome') . '</a></td>'; echo ' <td align="center">' . $posts['visitas'] . '</td>'; echo ' <td align="center"><a href="index2.php?exe=pagina/posts-edit&idpost=' . $posts['id'] . '" title="editar"> <img src="ico/edit.png" alt="editar" title="editar" /></a></td>'; echo ' <td align="center"><a href="index2.php?exe=pagina/gallery&idpost=' . $posts['id'] . '" title="postar galeria"> <img src="ico/bg.png" alt="postar galeria" title="postar galeria" /></a></td>'; echo '<td align="center"><a href="index2.php?exe=pagina/posts&pag=' . $pag . '&sts=' . $posts['status'] . '&id=' . $posts['id'] . '" title="' . $strStatus . '"><img src="' . $strIco . '" alt="' . $strStatus . '" title="' . $strStatus . '" /></a></td>'; echo ' <td align="center"> <a href="index2.php?exe=pagina/posts&thumb=' . $posts['thumb'] . '&pag=' . $pag . '&iddel=' . $posts['id'] . '" title="excluir"> <img src="ico/no.png" alt="excluir" title="excluir" /></a></td>'; echo '</tr>'; } } echo ' </table>'; $link = "index2.php?exe=pagina/posts&pag="; readPaginator("post", "WHERE tipo = 'post' {$_SESSION[where]} ORDER BY data DESC", $maximo, $link, $pag);