Browse Source

allow setting of name, email and website by get-variable

master
rwa 2 years ago
parent
commit
dd257de27f
  1. 40
      hashover.php

40
hashover.php

@ -51,6 +51,10 @@
}
}
if (isset($_GET['count_link']) && !empty($_GET['count_link'])) {
$count_query = 'true';
}
// Use UTF-8 character set
ini_set ('default_charset', 'UTF-8');
@ -122,6 +126,18 @@
}
}
// load username & email from $_GET
if ( isset($_GET['name']) && !empty($_GET['name']) ) {
setcookie('name', $_GET['name'], $expire, '/', str_replace('www.', '', $domain));
}
if ( isset($_GET['email']) && !empty($_GET['email']) ) {
setcookie('email', $_GET['email'], $expire, '/', str_replace('www.', '', $domain));
}
if ( isset($_GET['website']) && !empty($_GET['website']) ) {
setcookie('website', $_GET['website'], $expire, '/', str_replace('www.', '', $domain));
}
// Get use avatar URL by hash
function get_user_avatar ($hash) {
global $root_dir, $domain;
@ -173,13 +189,11 @@
exit(jsAddSlashes('<b>HashOver - Error:</b> Failed to create comment thread directory at "' . $dir . '"', 'single'));
}
}
// If the "count_link" query is set, display link to comment
if (isset($script_query)) {
if (isset($_GET['count_link']) and !empty($_GET['count_link'])) {
if (!file_exists($dir)) {
exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">' . $text['post_cmt'] . '</a>', 'single'));
}
if (isset($script_query) && isset($count_query)) {
if (!file_exists($dir)) {
exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">' . $text['post_cmt'] . '</a>', 'single'));
}
}
@ -210,15 +224,13 @@
}
// If the "count_link" query is set, echo comment count as link
if (isset($script_query)) {
if (isset($_GET['count_link']) and !empty($_GET['count_link'])) {
read_comments($dir, 'no'); // Run read_comments function
if (isset($script_query) && isset($count_query)) {
read_comments($dir, 'no'); // Run read_comments function
if ($total_count > 1) {
exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">' . display_count() . '</a>', 'single'));
} else {
exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">' . $text['post_cmt'] . '</a>', 'single'));
}
if ($total_count > 1) {
exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">' . display_count() . '</a>', 'single'));
} else {
exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">' . $text['post_cmt'] . '</a>', 'single'));
}
}

Loading…
Cancel
Save