Skip to content
Permalink
Browse files

redesigned user profile settings and cache lists; profile html text

  • Loading branch information...
following5 committed May 13, 2013
1 parent 821e766 commit 687e7af4b87dd894fe8d803858baf7caa131c8a3
Showing with 897 additions and 329 deletions.
  1. +18 −0 bin/dbsv-update.php
  2. +2 −2 htdocs/change_statpic.php
  3. +0 −1 htdocs/config2/settings-dev.inc.php
  4. +0 −5 htdocs/config2/settings-dist.inc.php
  5. +43 −40 htdocs/doc/sql/static-data/data.sql
  6. +2 −1 htdocs/doc/sql/stored-proc/maintain.php
  7. +2 −0 htdocs/doc/sql/tables/user.sql
  8. +1 −1 htdocs/lang/de/ocstyle/search.result.caches.row.tpl.php
  9. +22 −24 htdocs/lang/de/ocstyle/search.result.caches.tpl.php
  10. +30 −35 htdocs/lib/search.html.inc.php
  11. +65 −17 htdocs/mydetails.php
  12. +6 −10 htdocs/myprofile.php
  13. +207 −0 htdocs/mystatpic.php
  14. +1 −1 htdocs/newemail.php
  15. +1 −1 htdocs/recommendations.php
  16. +19 −5 htdocs/resource2/ocstyle/css/style_screen.css
  17. BIN htdocs/resource2/ocstyle/images/misc/32x32-ignore.png
  18. +42 −0 htdocs/resource2/tinymce/config/user.js.php
  19. +5 −2 htdocs/templates2/ocstyle/adoptcache.tpl
  20. +203 −0 htdocs/templates2/ocstyle/mydescription.tpl
  21. +58 −42 htdocs/templates2/ocstyle/mydetails.tpl
  22. +10 −11 htdocs/templates2/ocstyle/myignores.tpl
  23. +34 −41 htdocs/templates2/ocstyle/myprofile.tpl
  24. +43 −0 htdocs/templates2/ocstyle/mystatpic.tpl
  25. +12 −13 htdocs/templates2/ocstyle/mytop5.tpl
  26. +18 −18 htdocs/templates2/ocstyle/mywatches.tpl
  27. +2 −2 htdocs/templates2/ocstyle/newpw.tpl
  28. +16 −15 htdocs/templates2/ocstyle/query.tpl
  29. +9 −10 htdocs/templates2/ocstyle/recommendations.tpl
  30. +9 −8 htdocs/templates2/ocstyle/usertops.tpl
  31. +14 −24 htdocs/templates2/ocstyle/viewprofile.tpl
  32. +3 −0 htdocs/viewprofile.php
@@ -168,4 +168,22 @@ function dbv_104() // added maintenance logs and OC team comments
// values are initally zero.
}
function dbv_105() // HTML user profile texts
{
if (!field_exists('user','desc_htmledit'))
sql("ALTER TABLE `user` ADD COLUMN `desc_htmledit` tinyint(1) unsigned NOT NULL DEFAULT '1' AFTER `data_license`");
if (!field_exists('user','description'))
{
sql("ALTER TABLE `user` ADD COLUMN `description` mediumtext NOT NULL AFTER `data_license`");
$rs = sql("SELECT `user`.`user_id`,`user_options`.`option_value` FROM `user`,`user_options` WHERE `user_options`.`user_id`=`user`.`user_id` AND `user_options`.`option_id`=3");
while ($r = sql_fetch_array($rs))
{
$text = nl2br(htmlspecialchars($r['option_value'], ENT_COMPAT, 'UTF-8'));
sql("UPDATE `user` SET `description`='&2' WHERE `user_id`='&1'", $r['user_id'], $text);
}
sql_free_result($rs);
// we keep the old entries in user_options for the case something went wrong here.
}
}
?>
@@ -16,7 +16,7 @@
$tpl->redirect('login.php?target=change_statpic.php');
if (isset($_REQUEST['cancel']))
$tpl->redirect('myprofile.php');
$tpl->redirect('mystatpic.php');
$sp = new statpic($login->userid);
@@ -39,7 +39,7 @@
if (!$bError)
{
$sp->save();
$tpl->redirect('myprofile.php');
$tpl->redirect('mystatpic.php');
}
}
@@ -115,7 +115,6 @@
$opt['bin']['cs2cs'] = '/var/www/bin/cs2cs';
// other settings
$opt['logic']['enableHTMLInUserDescription'] = false;
$opt['page']['showdonations'] = true;
$opt['logic']['pictures']['dummy']['replacepic'] = $dev_basepath . $dev_codepath . 'htdocs/images/no_image_license.png';
@@ -321,11 +321,6 @@
*/
$opt['logic']['password_hash'] = false;
/* If the user entered HTML in his description do we
* display it as HTML or escape it and make it non-functional?
*/
$opt['logic']['enableHTMLInUserDescription'] = true;
/* new lows style
*/
$opt['logic']['new_logs_per_country'] = true;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1225,7 +1225,8 @@
NEW.`node`!=OLD.`node` OR
NEW.`date_created`!=OLD.`date_created` OR
NEW.`username`!=OLD.`username` OR
NEW.`pmr_flag`!=OLD.`pmr_flag` THEN
NEW.`pmr_flag`!=OLD.`pmr_flag` OR
NEW.`description`!=OLD.`description` THEN
SET NEW.`last_modified`=NOW();
END IF;
@@ -35,6 +35,8 @@ CREATE TABLE `user` (
`notify_radius` int(10) unsigned NOT NULL default '0',
`admin` tinyint(3) unsigned NOT NULL default '0',
`data_license` tinyint(1) NOT NULL default '0',
`description` mediumtext NOT NULL,
`desc_htmledit` tinyint(1) unsigned NUT NULL default '1',
PRIMARY KEY (`user_id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `uuid` (`uuid`),
@@ -4,7 +4,7 @@
<td width="45" class="{bgcolor}" style="{line_style}">{distance}&nbsp;</td>
<td width="32" class="{bgcolor}" rowspan="2"><img src='lang/de/ocstyle/images/{icon_large}' alt='{cachetype}' title='{cachetype}'></td>
<td width="46" class="{bgcolor}" rowspan="2" nowrap="nowarp">{diffpic}{terrpic}</td>
<td width="448" class="{bgcolor}">{new} <a href="viewcache.php?cacheid={urlencode_cacheid}"><span style="{status_style}">{cachename}</span></a> <span style="{line_style}">{string_by}</span> <a href="viewprofile.php?userid={urlencode_userid}" style="{line_style}">{username}</a><!-- Ocprop: <a href="viewcache.php?cacheid={urlencode_cacheid}">{cachename}</a> {string_by} <a href="viewprofile.php?userid={urlencode_userid}">{username}</a> --></td>
<td width="448" class="{bgcolor}">{new} <span style="{status_style}"><a href="viewcache.php?cacheid={urlencode_cacheid}"><span style="{name_style}">{cachename}</span></a></span> &nbsp;<span style="{line_style}">{string_by}</span> <a href="viewprofile.php?userid={urlencode_userid}" style="{line_style}">{username}</a><!-- Ocprop: <a href="viewcache.php?cacheid={urlencode_cacheid}">{cachename}</a> {string_by} <a href="viewprofile.php?userid={urlencode_userid}">{username}</a> --></td>
<td width="74" class="{bgcolor}" rowspan="2" style="padding: 0px">{oconly}</td>
<td width="110" valign="top" class="{bgcolor}">{logimage1} {logdate1}&nbsp;</td>
</tr>
@@ -28,10 +28,10 @@

<div class="content2-container bg-blue02" style="margin-top:20px;">
<p class="content-title-noshade-size3">
<img src="resource2/ocstyle/images/cacheicon/traditional.gif" width="32" height="32" style="align:left;margin-right:10px;" alt="{t}Search{/t}" />&nbsp;
<b>{t}Search result{/t}:</b> {t}{results_count} caches matched.{/t}
<img src="resource2/ocstyle/images/cacheicon/traditional.gif" width="32" height="32" style="align:left;" alt="{t}Search{/t}" />&nbsp;
{t}{results_count} caches matched{/t}
<span style="font-weight:normal;float:right;font-size:80%;" >
[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]<br />
[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]&nbsp;
[<a href="search.php?queryid={queryid}&showresult=0">{t}Edit options{/t}</a>]
</span>
</p>
@@ -44,11 +44,9 @@
<td class="header-small" colspan="2">
<table width="98.5%">
<tr>
<td>{pages}</td>
<td style="width:80px">
<b>{t}Downloads{/t}:</b>
</td>
<td style="width:120px">
<td width="100%">{pages}</td>
<td>{t}Download{/t}:</td>
<td>
<select name="wpdownload-page" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
<option value="#">{t}Results on this page{/t}</option>
<option value="search.php?queryid={queryid}&output=gpx&startat={startat}">GPX</option>
@@ -77,16 +75,17 @@
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
<tr>
<td colspan="2" style="padding-left: 0px; padding-right: 0px;">
<table border="0" cellspacing="0px" cellpadding="0px" class="null">
<tr class="searchresult">
<td width="18" height="13" bgcolor="#E6E6E6">&nbsp;#&nbsp;</td>
<td width="45" height="13" bgcolor="#E6E6E6"><b>{distanceunit}</b></td>
<td width="32" height="13" bgcolor="#E6E6E6"><b>{t}Type{/t}</b></td>
<td width="46" height="13" bgcolor="#E6E6E6"><b>{t}D/T{/t}</b></td>
<td width="448" height="13" bgcolor="#E6E6E6"><b>{t}Name{/t}</b></td>
<td width="48" height="13" bgcolor="#E6E6E6"><b>&nbsp;</b></td>
<td width="126" height="13" bgcolor="#E6E6E6"><b style="display:{displaylastlogs}">{t}Last logs{/t}</b><b style="display:{displayownlogs}">{t}Own logs{/t}</b></td>
<table border="0" cellspacing="0px" cellpadding="0px" class="searchtable">
<tr>
<th width="18" height="13" >&nbsp;#&nbsp;</th>
<th width="45" height="13">{distanceunit}</th>
<th width="32" height="13">{t}Type{/t}</th>
<th width="46" height="13">{t}D/T{/t}</th>
<th width="448" height="13">{t}Name{/t}</th>
<th width="48" height="13">&nbsp;</th>
<th width="126" height="13"><span style="display:{displaylastlogs}">{t}Last logs{/t}<span style="display:{displayownlogs}">{t}Own logs{/t}</th>
</tr>
<tr><td></td></tr>
<!--a-->{results}<!--z-->
</table>
</td>
@@ -97,26 +96,25 @@
</tr>
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
</table>
<table class="content">
<table class="content" width="100%">
<tr>
<td><b>{t}Downloads{/t}</b></td>
<td><b>{t}Download{/t}:</b></td>
<td align="right" style="padding-right:20px;">
{t}Results on this page:{/t}
<b>{t}Results on this page:{/t}</b>
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={queryid}&output=loc&startat={startat}" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={queryid}&output=kml&startat={startat}" title="{t}Google Earth .kml{/t}">KML</a>
<a href="http://maps.google.de/maps?f=q&hl=de&q=<?php echo urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml"); ?>" title="{t}Show in Google Maps{/t}">{t}(in GM){/t}</a>
<a href="search.php?queryid={queryid}&output=ov2&startat={startat}" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={queryid}&output=ovl&startat={startat}" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={queryid}&output=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT*</a>
<a href="search.php?queryid={queryid}&output=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT</a>
</td>
</tr>
<tr>
<td class="help">
{t}Download for local application{/t}
</td>
<td align="right" style="padding-right:20px;">
{t}Result {startatp1} to {endat} (as zip):{/t}
<b>{t}Result {startatp1} to {endat} (as zip):{/t}</b>
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={queryid}&output=loc&startat={startat}&count=max&zip=1" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={queryid}&output=kml&startat={startat}&count=max&zip=1" title="{t}Google Earth .kml{/t}">KML</a>
@@ -127,7 +125,7 @@
</td>
</tr>
<tr>
<td class="help" colspan="2" align="right">
<td class="help" colspan="2" align="right" style="line-height:2em;">
{t}With the download you accept the <a href="articles.php?page=impressum#tos">terms of use</a> from opencaching.de.&nbsp;&nbsp;{/t}
</td>
</tr>
@@ -227,29 +227,33 @@
// strikeout inavtive caches
// see also res_cachestatus_span.tpl
$line_style = "";
$status_style = ""; // (colored) strike-through for inactive caches
$line_style = ""; // color of the linked cache name
$name_style = ""; // color of "by <username>"
switch ($caches_record['status'])
{
case 2: // disabled
$status_style = "text-decoration: line-through;";
break;
case 3: // archived
case 6: // locked
$status_style = "text-decoration: line-through; color: grey";
$line_style = "color:grey";
$status_style = "text-decoration: line-through; color: #c00000;";
// $line_style = "color:grey";
break;
case 7: // locked, invisible
$status_style = "text-decoration: line-through; color: #e00000";
$line_style = "color:grey";
$name_style = "color: #e00000";
// $line_style = "color:grey";
break;
case 5: // not published yet
$status_style = "color: #e00000";
$name_style = "color: #e00000";
break;
default: $status_style = $line_style = "";
}
$tmpline = mb_ereg_replace('{line_style}', $line_style, $tmpline);
$tmpline = mb_ereg_replace('{status_style}', $status_style, $tmpline);
$tmpline = mb_ereg_replace('{name_style}', $name_style, $tmpline);
$tmpline = mb_ereg_replace('{desclangs}', $desclangs, $tmpline);
$tmpline = mb_ereg_replace('{cachename}', htmlspecialchars($caches_record['name'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{urlencode_cacheid}', htmlspecialchars(urlencode($caches_record['cache_id']), ENT_COMPAT, 'UTF-8'), $tmpline);
@@ -287,43 +291,34 @@
tpl_set_var('results', $caches_output);
//more than one page?
if ($startat > 0)
{ // Ocprop: queryid=([0-9]+)
$pages = t('Seite:') . ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=0">&lt;&lt;</a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat - $caches_per_page) . '">&lt;</a> ';
}
// more than one page?
if ($resultcount <= $caches_per_page)
$pages = '';
else
{
$pages = t('Seite:') . ' &lt;&lt; &lt; ';
}
$frompage = ($startat / $caches_per_page) - 3;
if ($frompage < 1) $frompage = 1;
$maxpage = ceil($resultcount / $caches_per_page);
if ($startat > 0) // Ocprop: queryid=([0-9]+)
$pages = '<a href="search.php?queryid=' . $options['queryid'] . '&startat=0"><img src="resource2/ocstyle/images/navigation/16x16-browse-first.png" width="16" height="16"></a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat - $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-prev.png" width="16" height="16"></a></a> ';
else
$pages = ' <img src="resource2/ocstyle/images/navigation/16x16-browse-first-inactive.png" width="16" height="16"></a> <img src="resource2/ocstyle/images/navigation/16x16-browse-prev-inactive.png" width="16" height="16"></a> ';
$topage = $frompage + 8;
if ($topage > $maxpage) $topage = $maxpage;
$frompage = ($startat / $caches_per_page) - 3;
if ($frompage < 1) $frompage = 1;
$maxpage = ceil($resultcount / $caches_per_page);
$topage = $frompage + 8;
if ($topage > $maxpage) $topage = $maxpage;
for ($i = $frompage; $i <= $topage; $i++)
{
if (($startat / $caches_per_page + 1) == $i)
{
$pages .= ' <b>' . $i . '</b>';
}
else
for ($i = $frompage; $i <= $topage; $i++)
{
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($i - 1) * $caches_per_page) . '">' . $i . '</a>';
if (($startat / $caches_per_page + 1) == $i)
$pages .= ' <b>' . $i . '</b>';
else
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($i - 1) * $caches_per_page) . '">' . $i . '</a>';
}
}
if ($startat / $caches_per_page < ($maxpage - 1))
{
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat + $caches_per_page) . '">&gt;</a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($maxpage - 1) * $caches_per_page) . '">&gt;&gt;</a> ';
}
else
{
$pages .= ' &gt; &gt;&gt;';
if ($startat / $caches_per_page < ($maxpage - 1))
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat + $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-next.png" width="16" height="16"></a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($maxpage - 1) * $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-last.png" width="16" height="16"></a> ';
else
$pages .= ' <img src="resource2/ocstyle/images/navigation/16x16-browse-next-inactive.png" width="16" height="16"> <img src="resource2/ocstyle/images/navigation/16x16-browse-last-inactive.png" width="16" height="16"></a>';
}
//'<a href="search.php?queryid=' . $options['queryid'] . '&startat=20">20</a> 40 60 80 100';
Oops, something went wrong.

0 comments on commit 687e7af

Please sign in to comment.
You can’t perform that action at this time.