function toolbox_gallery_extensions() { if (zp_loggedin(ADMIN_RIGHTS | COMMENT_RIGHTS)) { echo "<li>"; printLink(WEBPATH . "/" . ZENFOLDER . '/admin-comments.php', gettext("Comments"), NULL, NULL, NULL); echo "</li>\n"; } }
?> </div> <div id="comments"> <?php if (function_exists('printCommentForm')) { printCommentForm(); } ?> </div> </div> <div id="credit"><?php if (!zp_loggedin()) { printUserLogin_out($before = '', $after = '|', $showLoginForm = NULL, $logouttext = NULL, $show_user = NULL); } else { printLink(WEBPATH . '/' . ZENFOLDER . '/admin.php', 'Admin'); } printZenphotoLink(); ?> </div> <?php zp_apply_filter('theme_body_close'); ?> </body> </html>
<?php //Задача #1: //Да се създаде функция, която приема 2 параметъра - link и име и извежда линк, който сочи към подадения линк и в него пише подадения текст. //Примерно извикване: printLink('http://abv.bg/', 'Абв поща'); //Примерен изход: <a href="http://abv.bg/">Абв поща</a> echo "Solution #1:"; function printLink($link, $name) { echo @('<a href="' . $link . '">' . $name . '</a>'); } printLink('http://abv.bg/', 'Абв поща'); echo "<br/>"; echo "Solution #2:"; function printLink2($link, $name) { echo '<a href="' . $link . '">' . $name . '</a>'; } printLink2('http://abv.bg/', 'Абв поща');
echo getGalleryTitle(); ?> </a> | <?php printParentBreadcrumb(); ?> </span> <?php printAlbumTitle(true); ?> </h2> </div> ( <?php printLink(getPrevAlbumURL(), "« " . gettext("Prev Album")); ?> | <?php printLink(getNextAlbumURL(), gettext("Next Album") . " »"); ?> ) <hr /> <?php printTags('links', gettext('<strong>Tags:</strong>') . ' ', 'taglist', ''); ?> <?php printAlbumDesc(true); ?> <br /> <?php printPageListWithNav("« " . gettext("prev"), gettext("next") . " »");
/** * Creates a link to the admin comment edit page for the current comment * * @param string $text Link text * @param string $before text to go before the link * @param string $after text to go after the link * @param string $title title text * @param string $class optional css clasee * @param string $id optional css id */ function printEditCommentLink($text, $before = '', $after = '', $title = NULL, $class = NULL, $id = NULL) { global $_zp_current_comment; if (zp_loggedin(COMMENT_RIGHTS)) { echo $before; printLink(WEBPATH . '/' . ZENFOLDER . '/admin-comments.php?page=editcomment&id=' . $_zp_current_comment['id'], $text, $title, $class, $id); echo $after; } }
/** * Prints the album password form * * @param string $hint hint to the password * @param bool $showProtected set false to supress the password protected message * @param bool $showuser set true to force the user name filed to be present * *@since 1.1.3 */ function printPasswordForm($hint, $showProtected = true, $showuser = NULL) { global $_zp_login_error, $_zp_password_form_printed, $_zp_current_search, $_zp_gallery_page, $_zp_current_album, $_zp_current_image; if (is_null($showuser)) { $showuser = getOption('login_user_field'); } if ($_zp_password_form_printed) { return; } $_zp_password_form_printed = true; if ($_zp_login_error) { echo "<div class=\"errorbox\" id=\"message\"><h2>" . gettext("There was an error logging in.") . "</h2><br/>" . gettext("Check your user and password and try again.") . "</div>"; } switch ($_zp_gallery_page) { case 'index.php': $action = ""; break; case 'album.php': $action = '&album=' . urlencode($_zp_current_album->name); break; case 'image.php': $action = '&album=' . urlencode($_zp_current_album->name) . '&image=' . urlencode($_zp_current_image->filename); case 'full-image.php': $action = '&album=' . urlencode($_zp_current_album->name) . '&image=' . urlencode($_zp_current_image->filename) . '&p=*full-image'; break; default: if (in_context(ZP_SEARCH)) { $action = "&p=search" . $_zp_current_search->getSearchParams(); } else { $action = '&p=' . substr($_zp_gallery_page, 0, -4); } } if ($showProtected && !$_zp_login_error) { echo "\n<p>" . gettext("The page you are trying to view is password protected.") . "</p>"; } echo "\n<br/>"; echo "\n <form name=\"password\" action=\"?userlog=1{$action}\" method=\"POST\">"; echo "\n <input type=\"hidden\" name=\"password\" value=\"1\" />"; echo "\n <table>"; if ($showuser) { echo "\n <tr><td style=\"text-align:right\">" . gettext("Login") . " </td><td style=\"text-align:left;\"><input type=\"text\" size=\"38\" name=\"user\" /></td></tr>"; } echo "\n <tr><td style=\"text-align:right\">" . gettext("Password") . " </td><td style=\"text-align:left;\"><input type=\"password\" size=\"40\" name=\"pass\" /></td></tr>"; echo "\n <tr><td></td><td style=\"text-align:left\" ><input class=\"button\" type=\"submit\" value=\"" . gettext("Submit") . "\" /></td></tr>"; if (!empty($hint)) { echo "\n <tr><td style=\"text-align:left\">" . sprintf(gettext("Hint: %s"), $hint) . "</td></tr>"; } echo "\n </table>"; echo "\n </form>"; $registerpage = getOption('user_registration_page'); if (!empty($registerpage) && file_exists(SERVERPATH . '/' . THEMEFOLDER . '/' . getOption('current_theme') . '/' . UTF8ToFilesystem($registerpage) . '.php')) { if (getOption('mod_rewrite')) { $link = '/page/' . $registerpage; } else { $link = 'index.php?p=' . $registerpage; } printLink($link, get_language_string(getOption('user_registration_text')), get_language_string(getOption('user_registration_tip'))); } }
/** * Print a link that will take the user to the actual album. E.g. useful for View Album. * * @param $album The album to view. * @param $text Text for the hyperlink. * @param $title Optional title attribute for the hyperlink. Default is NULL. * @param $class Optional class attribute for the hyperlink. Default is NULL. * @param $id Optional id attribute for the hyperlink. Default is NULL. * * @author Todd Papaioannou (lucky@luckyspin.org) * @since 1.0.0 */ function printViewLink($album, $text, $title = NULL, $class = NULL, $id = NULL) { printLink(WEBPATH . "/index.php?album=" . urlencode($album->getFolder()), $text, $title, $class, $id); }
static function printNavigation($prevtext, $nexttext, $oneImagePage = false, $navlen = 7, $firstlast = true) { $total = getTotalPages($oneImagePage); $current = getCurrentPage(); if ($total < 2) { $class .= ' disabled_nav'; } if ($navlen == 0) { $navlen = $total; } $extralinks = 2; if ($firstlast) { $extralinks += 2; } $len = floor(($navlen - $extralinks) / 2); $j = max(round($extralinks / 2), min($current - $len - (2 - round($extralinks / 2)), $total - $navlen + $extralinks - 1)); $ilim = min($total, max($navlen - round($extralinks / 2), $current + floor($len))); $k1 = round(($j - 2) / 2) + 1; $k2 = $total - round(($total - $ilim) / 2); if ($firstlast) { echo '<div class="nav-cell ' . ($current == 1 ? 'current' : 'first') . '">'; echo "<span class='valign'>"; printLink(getPageURL(1, $total), 1, "Page 1"); echo "</span></div>\n"; if ($j > 2) { echo '<div class="nav-cell">'; echo "<span class='valign'>"; printLink(getPageURL($k1, $total), $j - 1 > 2 ? '...' : $k1, "Page {$k1}"); echo "</span></div>\n"; } } for ($i = $j; $i <= $ilim; $i++) { echo '<div class="nav-cell' . ($i == $current ? " current" : "") . '">'; echo "<span class='valign'>"; printLink(getPageURL($i, $total), $i, "Page {$i}" . ($i == $current ? ' ' . gettext("(Current Page)") : "")); echo "</span></div>\n"; } if ($i < $total) { echo '<div class="nav-cell">'; echo "<span class='valign'>"; printLink(getPageURL($k2, $total), $total - $i > 1 ? '...' : $k2, "Page {$k2}"); echo "</span></div>\n"; } if ($firstlast && $i <= $total) { echo '<div class="nav-cell last">'; echo "<span class='valign'>"; printLink(getPageURL($total, $total), $total, "Page {$total}"); echo "</span></div>\n"; } $prevNextLinks = array(); $prevNextLinks['prev'] = ThemeUtil::getLink(getPrevPageURL(), $prevtext) . "\n"; $prevNextLinks['next'] = ThemeUtil::getLink(getNextPageURL(), $nexttext) . "\n"; return $prevNextLinks; }