function printResultWithX($result)
{
    $rowNum = $result->num_rows;
    echo '<h1>' . $rowNum . ' cookbooks were found:</h1>';
    while ($rowNum > 0) {
        echo '<div class="recipe-preview-row">';
        for ($i = 0; $i < 3; $i++) {
            if ($row = $result->fetch_assoc()) {
                if (isVisible($row["cookbook_id"])) {
                    $path = getImage($row["cookbook_id"]);
                    echo '<a href="view-cookbook.php?cookbook_id=' . $row["cookbook_id"] . '">
								<div class="recipe-preview-row-icon">
									<img class="thumbnail" src="' . $path . '">
									<p>' . $row["cb_title"] . '</p>
								</div>
							</a>
							<a href="delete.php?cookbook_id=' . $row["cookbook_id"] . '" onclick="return confirm(\'Are you sure you want to delete ' . $row["cb_title"] . '\');">
								<img class="x" src="images/x.png"></a>';
                }
            }
            $rowNum = $rowNum - 1;
        }
        echo '</div>';
    }
}
Example #2
0
function isVisible($id, $ids)
{
    $id = substr($id, 8);
    $pid = array_shift(mysql_fetch_row(mysql_query('SELECT pid FROM tree WHERE id=' . $id)));
    $pid = 'cb_node_' . $pid;
    if (!in_array($pid, $ids)) {
        return false;
    }
    if ($pid != 'cb_node_' . $id) {
        return isVisible($pid, $ids);
    }
    return true;
}
Example #3
0
function listCategories($parentid)
{
    global $db, $config, $current_language;
    $tbl_cat = MYSQL_TABLE_PREFIX . 'media_categories';
    $p = (int) $parentid;
    $list = $db->selectList($tbl_cat, "*", "`parentid`=" . $p . " AND (`language` = '' OR `language` = '" . secureMySQL($current_language) . "')", "`name` ASC");
    if (count($list) > 0) {
        foreach ($list as $i => $l) {
            if (isVisible($l['categoryid'])) {
                $list[$i]['url'] = makeURL('media', array('categoryid' => $l['categoryid']));
                if ($config->get('media', 'hide-submedia') != '1') {
                    $childCategories = getSubCategories($l['categoryid']);
                    $list[$i]['subcategoriescount'] = count($childCategories);
                    $categories = $childCategories;
                    $categories[] = $l['categoryid'];
                    $catMerge = implode($categories, ",");
                    $list[$i]['mediacount'] = (int) countDownloads($catMerge) + (int) countPictures($catMerge) + (int) countMovies($catMerge);
                }
                $list2[] = $list[$i];
            }
        }
    }
    return @$list2;
}
Example #4
0
             echo '<rect class="highlight" id="highlightpawn' . $p["idPawn"] . '" width=570px height=700px style="fill:none;stroke-width:50;stroke:orange" visibility="hidden"/>';
             echo "</g> <!-- close Pawn-->\n";
         }
     }
     echo "</g> <!--close mapg-->\n";
     // lets point a pointer on every pawnGrid
     $pointers = $conn->query("SELECT * FROM Pointer WHERE idMap = " . $m["idMap"]);
     if ($pointers->num_rows > 0) {
         while ($p = $pointers->fetch_assoc()) {
             echo "<!-- open Pointer-->\n";
             echo '<g id="pointer' . $p["idPointer"] . '" ' . "\n";
             echo '   class="Pointer" ' . "\n";
             echo '   onmap="map' . $p["idMap"] . '" ' . "\n";
             echo '   type="image/svg+xml"' . "\n";
             echo '   selectkey="' . $p["selectKey"] . '" ' . "\n";
             if (isVisible($p, "")) {
                 echo '   visibility="visible" ' . "\n";
                 echo '   display="inline" ' . "\n";
             } else {
                 echo '   visibility="hidden" ' . "\n";
                 echo '   display="none" ' . "\n";
             }
             echo '   transform="rotate(' . $p['rotate'] . ') translate(' . $p['translateX'] . ',' . $p['translateY'] . ') scale(' . $p['scale'] . ')" ' . "\n";
             echo '   updated="2000-01-01 01:00:00" ' . "\n";
             echo '   updatedby="' . $updater . '" ' . "\n";
             echo $p["shapeSvg"];
             echo "</g> <!--close Pointer-->";
         }
     }
     echo "</svg> <!--close Map-->\n";
 }
Example #5
0
                 $stat['max'] = $max;
                 $stat['export_url'] = 'ajax_request.php?mod=media&amp;file=stat.export&amp;downloadid=' . $downloadid . '&amp;month=' . $month . '&amp;year=' . $year;
                 $smarty->assign('dl_stat', $stat);
             }
         }
         if ($rights->isAllowed($mod, 'manage')) {
             $menu->addSubElement($mod, $lang->get('download_stat'), '', array('categoryid' => $categoryid, 'downloadid' => $downloadid, 'statistic' => ''));
         }
     } else {
         $notify->add($lang->get('media'), $lang->get('access_denied'));
     }
     $showcategories = false;
 }
 if ($movieid > 0) {
     $mv = getMovie($movieid);
     if (isVisible($mv['categoryid'])) {
         $breadcrumbs->addElement($mv['name'], makeURL($mod, array('categoryid' => $categoryid, 'movieid' => $movieid)));
         $smarty->assign('movie', $mv);
         $smarty->assign('path', $template_dir . "/movie.tpl");
         if ($login->currentUser() !== false) {
             $smarty->assign('loggedin', true);
             if (isset($_POST['add'])) {
                 $comments->add($mod . '-movie', $login->currentUserID(), $_POST['comment'], $movieid);
             }
         }
         $smarty->assign('comments', $comments->get($mod . '-movie', $movieid));
     } else {
         $notify->add($lang->get('media'), $lang->get('access_denied'));
     }
     $showcategories = false;
 }
<?php

// Create connection
$conn = db_connect($app->config('db'));
function isVisible($row, $mode)
{
    if ($mode == "dm" && $row['dmVisible'] == 1) {
        return True;
    } elseif ($row['visible'] == 1) {
        return True;
    } else {
        return False;
    }
}
$sql = "SELECT * FROM " . $_POST["table"] . " WHERE id" . $_POST["table"] . " = " . $_POST['id'];
$row = $conn->query($sql)->fetch_assoc();
if (isVisible($row, "pc")) {
    $sql2 = "UPDATE " . $_POST["table"] . " SET visible=0 WHERE id" . $_POST["table"] . " = " . $_POST['id'];
} else {
    $sql2 = "UPDATE " . $_POST["table"] . " SET visible=1 WHERE id" . $_POST["table"] . " = " . $_POST['id'];
}
$conn->query($sql2);
$conn->close();