[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1672] add anticommercial checkbox
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1672] add anticommercial checkbox |
Date: |
Sat, 16 May 2009 19:29:19 +0000 |
Revision: 1672
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1672
Author: clint
Date: 2009-05-16 19:29:19 +0000 (Sat, 16 May 2009)
Log Message:
-----------
add anticommercial checkbox
Modified Paths:
--------------
trunk/gnukebox/install.php
trunk/nixtape/data/User.php
trunk/nixtape/themes/librefm/templates/user-edit.tpl
trunk/nixtape/user-edit.php
Modified: trunk/gnukebox/install.php
===================================================================
--- trunk/gnukebox/install.php 2009-05-16 19:02:55 UTC (rev 1671)
+++ trunk/gnukebox/install.php 2009-05-16 19:29:19 UTC (rev 1672)
@@ -74,6 +74,7 @@
created INTEGER NOT NULL,
modified INTEGER,
userlevel INTEGER DEFAULT 0,
+ anticommercial INTEGER DEFAULT 0,
webid_uri VARCHAR(255),
avatar_uri VARCHAR(255),
active INTEGER DEFAULT 1,
Modified: trunk/nixtape/data/User.php
===================================================================
--- trunk/nixtape/data/User.php 2009-05-16 19:02:55 UTC (rev 1671)
+++ trunk/nixtape/data/User.php 2009-05-16 19:29:19 UTC (rev 1672)
@@ -34,7 +34,7 @@
public $name, $email, $fullname, $bio, $location, $homepage, $error,
$userlevel;
public $id, $acctid, $avatar_uri, $location_uri, $webid_uri,
$laconica_profile, $journal_rss;
- public $password, $has_identica, $created, $modified, $uniqueid;
+ public $password, $has_identica, $created, $modified, $uniqueid,
$anticommercial;
/**
* User constructor
@@ -78,6 +78,7 @@
$this->created = $row['created'];
$this->modified = $row['modified'];
$this->uniqueid = $row['uniqueid'];
+ $this->anticommercial = $row['anticommercial'];
$this->has_identica =
preg_match('#^http://identi\.ca/#i', $this->laconica_profile);
@@ -124,6 +125,7 @@
. 'avatar_uri=%s, '
. 'laconica_profile=%s, '
. 'journal_rss=%s, '
+ . 'anticommercial=%d, '
. 'modified=%d '
. 'WHERE username=%s'
, $adodb->qstr($this->email)
@@ -138,6 +140,7 @@
, $adodb->qstr($this->avatar_uri)
, $adodb->qstr($this->laconica_profile)
, $adodb->qstr($this->journal_rss)
+ , (int)($this->anticommercial)
, time()
, $adodb->qstr($this->name));
Modified: trunk/nixtape/themes/librefm/templates/user-edit.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-edit.tpl 2009-05-16
19:02:55 UTC (rev 1671)
+++ trunk/nixtape/themes/librefm/templates/user-edit.tpl 2009-05-16
19:29:19 UTC (rev 1672)
@@ -59,6 +59,11 @@
<td><a href="#dfn_journal_rss" rel="glossary">{t}What's
this?{/t}</a></td>
</tr>
<tr>
+ <th align="right" valign="top"><label
for="anticommercial">{t}Anticommercial{/t}</label></th>
+ <td><input name="anticommercial" id="anticommercial"
type="checkbox"{if $anticommercial == 1} checked="checked"{/if} /></td>
+ <td><a href="#dfn_anticommercial"
rel="glossary">{t}What's this?{/t}</a></td>
+ </tr>
+ <tr>
<th align="right" valign="top"><label
for="password_1">{t}Password:{/t}</label></th>
<td><input name="password_1" id="password_1"
type="password" value="" /></td>
<td rowspan="2">{t}Leave this blank if you don't want
to change your password.{/t}</td>
@@ -88,6 +93,12 @@
<dt id="dfn_id">WebID (FOAF)</dt>
<dd>{t escape=no}A URI that represents you in RDF. See <a
href="http://esw.w3.org/topic/WebID">WebID</a> for details. If you don't know
what this is, it's best to leave it blank.{/t}</dd>
+
+ <dt id="dfn_anticommercial">Anticommercial</dt>
+ <dd>{t escape=no}By enabling this option, you will not be shown
advertisements or affiliate purchase links.{/t}</dd>
</dl>
{include file='footer.tpl'}
+</dl>
+
+{include file='footer.tpl'}
Modified: trunk/nixtape/user-edit.php
===================================================================
--- trunk/nixtape/user-edit.php 2009-05-16 19:02:55 UTC (rev 1671)
+++ trunk/nixtape/user-edit.php 2009-05-16 19:29:19 UTC (rev 1672)
@@ -113,6 +113,7 @@
$this_user->avatar_uri = $_POST['avatar_uri'];
$this_user->laconica_profile = $_POST['laconica_profile'];
$this_user->journal_rss = $_POST['journal_rss'];
+ $this_user->anticommercial = $_POST['anticommercial'] == "on"
? 1 : 0;
if (!empty( $_POST['password_1'] ))
$user->password = md5($_POST['password_1']);
@@ -155,6 +156,7 @@
$smarty->assign('avatar_uri', $_POST['avatar_uri']);
$smarty->assign('laconica_profile', $_POST['laconica_profile']);
$smarty->assign('journal_rss', $_POST['journal_rss']);
+ $smarty->assign('anticommercial', $_POST['anticommercial']);
}
else
{
@@ -167,6 +169,7 @@
$smarty->assign('avatar_uri', ($this_user->avatar_uri));
$smarty->assign('laconica_profile',
($this_user->laconica_profile));
$smarty->assign('journal_rss', ($this_user->journal_rss));
+ $smarty->assign('anticommercial', $this_user->anticommercial);
}
# And display the page.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1672] add anticommercial checkbox,
Clint Adams <=