git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 4822b6c5 authored by P. J. McDermott's avatar P. J. McDermott

Finish code cleanup in nixtape/.

parent b0edc783
......@@ -51,10 +51,10 @@ if (isset($this_user) && $this_user->manages($artist->name)) {
$smarty->assign('extra_head_links', array(
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'Album Metadata',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(htmlentities(str_replace($base_url, '', $album->getURL())))
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(htmlentities(str_replace($base_url, '', $album->getURL())))
)
));
......
......@@ -21,7 +21,7 @@
if (!file_exists(dirname(__FILE__) . '/config.php')) {
die('Please run the <a href=\'install.php\'>Install</a> script to configure your installation');
die('Please run the <a href="install.php">Install</a> script to configure your installation');
}
require_once('config.php');
......
......@@ -19,9 +19,9 @@
*/
require_once ('templating.php');
require_once ('data/User.php');
require_once ('utils/random_code_generator.php');
require_once('templating.php');
require_once('data/User.php');
require_once('utils/random_code_generator.php');
if ($logged_in == false) {
$smarty->assign('pageheading', 'Error!');
......@@ -72,7 +72,7 @@ if ($logged_in == false) {
$code = generateCode();
$username = $this_user->name;
$email = $this_user->email;
$expire = time()+86400;
$expire = time() + 86400;
$adodb->Execute('INSERT INTO Delete_Request (code, expires, username) VALUES (' . $adodb->qstr($code) . ', ' . $adodb->qstr($expire) . ',' . $adodb->qstr($username) . ')');
$url = $base_url . '/delete-profile.php?code=' . $code;
$content = "Hi!\n\nSomeone from the IP address " . $_SERVER['REMOTE_ADDR'] . " requested account deletion at libre.fm. To remove this account click: \n\n" . $url . "\n\n- The Libre.fm Team";
......
......@@ -32,7 +32,7 @@ if ($logged_in == false) {
die();
}
if ($_REQUEST['group']=='new') {
if ($_REQUEST['group'] == 'new') {
if ($_REQUEST['new']) {
try {
$result = Group::create(strtolower($_REQUEST['new']), $this_user);
......
......@@ -25,7 +25,7 @@ require_once('data/Group.php');
require_once('data/TagCloud.php');
require_once('data/Server.php');
?><h1>Groups are disabled</h1><?php
?><h1>Groups are disabled</h1><?php
// if (! $_GET['group'])
// {
......
......@@ -54,7 +54,7 @@ if (isset($_POST['install'])) {
$default_theme = $_POST['default_theme'];
$base_url = $_POST['base_url'];
if ($base_url[strlen($base_url)-1] === '/') {
if ($base_url[strlen($base_url) - 1] === '/') {
$base_url = substr($base_url, 0, -1);
}
......
......@@ -19,8 +19,8 @@
*/
require_once 'config.php';
require_once 'utils/arc/ARC2.php';
require_once('config.php');
require_once('utils/arc/ARC2.php');
$page = $_GET['page'];
$fmt = $_GET['fmt'];
......@@ -38,15 +38,15 @@ $index = $parser->getSimpleIndex(0);
$conf = array(
'ns' => array(
'xhv' => 'http://www.w3.org/1999/xhtml/vocab#',
'dc' => 'http://purl.org/dc/terms/',
'xhv' => 'http://www.w3.org/1999/xhtml/vocab#',
'dc' => 'http://purl.org/dc/terms/',
'foaf' => 'http://xmlns.com/foaf/0.1/',
'bio' => 'http://purl.org/vocab/bio/0.1/',
'bio' => 'http://purl.org/vocab/bio/0.1/',
'sioc' => 'http://rdfs.org/sioc/ns#',
'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',
'gob' => 'http://purl.org/ontology/last-fm/',
'mo' => 'http://purl.org/ontology/mo/',
'rss' => 'http://purl.org/rss/1.0/'
'gob' => 'http://purl.org/ontology/last-fm/',
'mo' => 'http://purl.org/ontology/mo/',
'rss' => 'http://purl.org/rss/1.0/'
)
);
......
......@@ -129,7 +129,7 @@ if (isset($_POST['register'])) {
$sql = 'INSERT INTO AccountActivation (username, authcode, expires) VALUES('
. $adodb->qstr($username) . ', '
. $adodb->qstr($code) . ', '
. (time()+(86400*2)) . ')';
. (time() + (86400 * 2)) . ')';
try {
$res = $adodb->Execute($sql);
} catch (Exception $e) {
......
......@@ -48,7 +48,7 @@ if (isset($_GET['code'])) {
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 0; $i < 8; $i++) {
$password .= substr($chars, mt_rand(0, strlen($chars)-1), 1);
$password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
$email = $row['email'];
......
......@@ -63,7 +63,7 @@ $smarty->assign('this_page', $_SERVER['REQUEST_URI']);
$smarty->assign('this_page_absolute',
(empty($_SERVER['HTTPS']) ? 'http://' : 'http://')
. (empty($_SERVER['HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HOST'])
. (($_SERVER['SERVER_PORT']==80) ? '' : (':'.$_SERVER['SERVER_PORT']))
. (($_SERVER['SERVER_PORT'] == 80) ? '' : (':' . $_SERVER['SERVER_PORT']))
. $_SERVER['REQUEST_URI']);
if (isset($logged_in)) {
......
......@@ -56,10 +56,10 @@ $smarty->assign('groups', Group::groupList($user));
$smarty->assign('extra_head_links', array(
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL('groups')))
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL('groups')))
)
));
......
......@@ -59,14 +59,14 @@ krsort($index); // Newest last.
$items = array();
foreach ($index as $subject => $data) {
if (in_array('http://purl.org/rss/1.0/item', $data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'])) {
$ts = strtotime($data[ 'http://purl.org/dc/elements/1.1/date' ][0]);
$ts = strtotime($data['http://purl.org/dc/elements/1.1/date'][0]);
$items[] = array(
'subject_uri' => $subject,
'title' => $data['http://purl.org/rss/1.0/title'][0],
'link' => $data['http://purl.org/rss/1.0/link'][0],
'date_iso' => $data['http://purl.org/dc/elements/1.1/date'][0],
'date_unix' => $ts,
'date_human' => human_timestamp($ts)
'title' => $data['http://purl.org/rss/1.0/title'][0],
'link' => $data['http://purl.org/rss/1.0/link'][0],
'date_iso' => $data['http://purl.org/dc/elements/1.1/date'][0],
'date_unix' => $ts,
'date_human' => human_timestamp($ts)
);
}
}
......@@ -82,16 +82,16 @@ $smarty->assign('profile', true);
$smarty->assign('items', $items);
$smarty->assign('extra_head_links', array(
array(
'rel'=>'alternate',
'type' => 'application/rss+xml',
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Journal)',
'href' => $user->journal_rss
'href' => $user->journal_rss
),
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
)
));
$smarty->display('user-journal.tpl');
......@@ -62,27 +62,27 @@ if (isset($user->name)) {
$smarty->assign('extra_head_links', array(
array(
'rel'=>'alternate',
'type' => 'application/rss+xml',
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Recent plays)',
'href' => $base_url . '/rdf.php?fmt=rss&page=' . urlencode(str_replace($base_url, '', $user->getURL('recent-tracks')))
'href' => $base_url . '/rdf.php?fmt=rss&page=' . urlencode(str_replace($base_url, '', $user->getURL('recent-tracks')))
),
array(
'rel'=>'alternate',
'type' => 'application/rss+xml',
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Journal)',
'href' => $user->journal_rss
'href' => $user->journal_rss
),
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
)
));
$neighbours = $user->getNeighbours(9);
if(!empty($neighbours)) {
if (!empty($neighbours)) {
$smarty->assign('neighbours', $neighbours);
$smarty->assign('sideblocks', array('sidebar-neighbours.tpl'));
}
......
......@@ -65,16 +65,16 @@ $smarty->assign('pagetitle', $user->name . '\'s recent tracks');
$smarty->assign('extra_head_links', array(
array(
'rel'=>'alternate',
'type' => 'application/rss+xml',
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Recent plays)',
'href' => $base_url . '/rdf.php?fmt=rss&page=' . urlencode(str_replace($base_url, '', $user->getURL('recent-tracks')))
'href' => $base_url . '/rdf.php?fmt=rss&page=' . urlencode(str_replace($base_url, '', $user->getURL('recent-tracks')))
),
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
)
));
......
......@@ -37,7 +37,7 @@ try {
$user = new User($_GET['user']);
} catch (Exception $e) {
if ($e->getCode() == 22) {
echo('We had some trouble locating that user. Are you sure you spelled it correctly?'."\n");
echo('We had some trouble locating that user. Are you sure you spelled it correctly?' . "\n");
} else {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
......@@ -74,10 +74,10 @@ if (isset($user->name)) {
$smarty->assign('extra_head_links', array(
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
'href' => $base_url . '/rdf.php?fmt=xml&page=' . urlencode(str_replace($base_url, '', $user->getURL()))
)
));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment