diff options
-rw-r--r-- | web/lib/pkgfuncs.inc.php | 1 | ||||
-rw-r--r-- | web/template/actions_form.php | 2 | ||||
-rw-r--r-- | web/template/pkg_details.php | 17 |
3 files changed, 20 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 0610617..1351e72 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -368,6 +368,7 @@ function pkgname_is_blacklisted($name, $dbh=NULL) { # function package_details($id=0, $SID="", $dbh=NULL) { global $AUR_LOCATION; + global $USE_VIRTUAL_URLS; if(!$dbh) { $dbh = db_connect(); diff --git a/web/template/actions_form.php b/web/template/actions_form.php index 045022d..c58b3ec 100644 --- a/web/template/actions_form.php +++ b/web/template/actions_form.php @@ -5,6 +5,7 @@ <input type="hidden" name="ID" value="<?php echo $row['ID'] ?>" /> <input type="hidden" name="token" value="<?php echo htmlspecialchars($_COOKIE['AURSID']) ?>" /> + <?php if (!$USE_VIRTUAL_URLS): ?> <?php if (user_voted($uid, $row['ID'])): ?> <input type="submit" class="button" name="do_UnVote" value="<?php echo __("UnVote") ?>" /> <?php else: ?> @@ -22,6 +23,7 @@ <?php else: ?> <input type="submit" class="button" name="do_UnFlag" value="<?php echo __("UnFlag Out-of-date") ?>" /> <?php endif; ?> + <?php endif; ?> <?php if ($row["MaintainerUID"] === NULL): ?> <input type="submit" class="button" name="do_Adopt" value="<?php echo __("Adopt Packages") ?>" /> diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 6e19b3b..7542ea8 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -37,6 +37,23 @@ $sources = package_sources($row["ID"]); <li><a href="<?php echo $urlpath ?>/PKGBUILD"><?php echo __('View PKGBUILD') ?></a></li> <li><a href="<?php echo $urlpath . '/' . $row['Name'] ?>.tar.gz"><?php echo __('Download tarball') ?></a></li> <li><span class="flagged"><?php if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?></span></li> + <?php if ($USE_VIRTUAL_URLS && $uid): ?> + <?php if (user_voted($uid, $row['ID'])): ?> + <li><a href="<?php echo get_pkg_uri($row['Name']) . 'unvote/'; ?>"><?php echo __('UnVote'); ?></a></li> + <?php else: ?> + <li><a href="<?php echo get_pkg_uri($row['Name']) . 'vote/'; ?>"><?php echo __('Vote'); ?></a></li> + <?php endif; ?> + <?php if (user_notify($uid, $row['ID'])): ?> + <li><a href="<?php echo get_pkg_uri($row['Name']) . 'unnotify/'; ?>"><?php echo __('UnNotify'); ?></a></li> + <?php else: ?> + <li><a href="<?php echo get_pkg_uri($row['Name']) . 'notify/'; ?>"><?php echo __('Notify'); ?></a></li> + <?php endif; ?> + <?php if ($row["OutOfDateTS"] === NULL): ?> + <li><a href="<?php echo get_pkg_uri($row['Name']) . 'flag/'; ?>"><?php echo __('Flag'); ?></a></li> + <?php else: ?> + <li><a href="<?php echo get_pkg_uri($row['Name']) . 'unflag/'; ?>"><?php echo __('UnFlag'); ?></a></li> + <?php endif; ?> + <?php endif; ?> </ul> </div> </div> |