- fixed caching, by escaping control chars
 - rough support for shortened urls .. kinda
 - achievements shows icons for required items again; also can get name for quest
This commit is contained in:
Sarjuuk
2013-07-11 22:43:53 +02:00
parent 49800da2c8
commit 55c14eee5c
4 changed files with 23 additions and 25 deletions

View File

@@ -17,13 +17,14 @@ AddDefaultCharset utf8
CharsetRecodeMultipartForms Off CharsetRecodeMultipartForms Off
</IfModule> </IfModule>
php_value default_charset UTF-8 php_value default_charset UTF-8
RewriteEngine on RewriteEngine on
# Mapper-Helper: If you cant provide maps for all locales, redirect the browser # Mapper-Helper: If you cant provide maps for all locales, redirect the browser
RewriteRule ^images/maps/(frfr|dede|eses|ruru)/(.*)$ images/maps/enus/$2 [NC] RewriteRule ^images/maps/(frfr|dede|eses|ruru)/(.*)$ images/maps/enus/$2 [NC]
# accept flattened urls | NYI - need more work :x # accept flattened urls | NYI - need more work :x
# RewriteRule ^([a-z0-9]+)=([^?&/=]*)(.*)$ index.php?$1=$2&$3 [NC] RewriteRule ^([a-z0-9\-]+)$ ?$1 [NC] # /items => ?items
RewriteRule ^([a-z0-9\-]+)=([^?&]*)$ ?$1=$2 [NC] # /items=4.1 => ?items=4.1
RewriteRule ^([a-z0-9\-]+)=([^?&]*)[&?](.*)$ ?$1=$2&$3 [NC] # /items=4.1?filter=sl=7 => ?items=4.1&filter=sl=7

View File

@@ -836,7 +836,7 @@ class SmartyAoWoW extends Smarty
$file = $this->cache_dir.'data/'.$key; $file = $this->cache_dir.'data/'.$key;
$cacheData = time()." ".AOWOW_REVISION."\n"; $cacheData = time()." ".AOWOW_REVISION."\n";
$cacheData .= serialize($data); $cacheData .= serialize(str_replace(["\n", "\t"], ['\n', '\t'], $data));
if ($filter) if ($filter)
$cacheData .= "\n".serialize($filter); $cacheData .= "\n".serialize($filter);
@@ -861,7 +861,7 @@ class SmartyAoWoW extends Smarty
if ($expireTime <= time() || $rev < AOWOW_REVISION) if ($expireTime <= time() || $rev < AOWOW_REVISION)
return false; return false;
$data = unserialize($cache[1]); $data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[1]));
if (isset($cache[2])) if (isset($cache[2]))
$filter = unserialize($cache[2]); $filter = unserialize($cache[2]);

View File

@@ -261,7 +261,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
break; break;
// link to quest // link to quest
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
$crtName = Quest::getName($obj); $crtName = QuestList::getName($obj);
$tmp['link'] = array( $tmp['link'] = array(
'href' => '?quest='.$obj, 'href' => '?quest='.$obj,
'text' => $crtName ? $crtName : $crtName, 'text' => $crtName ? $crtName : $crtName,

View File

@@ -23,9 +23,9 @@
<tr><td><div class="infobox-spacer"></div> <tr><td><div class="infobox-spacer"></div>
<ul> <ul>
{if $lvData.page.points}<li><div>{$lang.points}: <span class="moneyachievement tip" onmouseover="Listview.funcBox.moneyAchievementOver(event)" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">{$lvData.page.points}</span></div></li>{/if} {if $lvData.page.points}<li><div>{$lang.points}: <span class="moneyachievement tip" onmouseover="Listview.funcBox.moneyAchievementOver(event)" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">{$lvData.page.points}</span></div></li>{/if}
{foreach from=$lvData.infoBox item=info} {foreach from=$lvData.infoBox item=info}
<li><div>{$info}</div></li> <li><div>{$info}</div></li>
{/foreach} {/foreach}
{*<li><div>Location: {$lvData.page.location}</div></li> todo: need to be parsed first *} {*<li><div>Location: {$lvData.page.location}</div></li> todo: need to be parsed first *}
</ul> </ul>
</td></tr> </td></tr>
@@ -34,7 +34,7 @@
<tr><th>{$lang.series}</th></tr> <tr><th>{$lang.series}</th></tr>
<tr><td><div class="infobox-spacer"></div> <tr><td><div class="infobox-spacer"></div>
<table class="series"> <table class="series">
{section name=i loop=$lvData.page.series} {section name=i loop=$lvData.page.series}
<tr> <tr>
<th>{$smarty.section.i.index+1}.</th> <th>{$smarty.section.i.index+1}.</th>
<td> <td>
@@ -45,7 +45,7 @@
{/if} {/if}
</td> </td>
</tr> </tr>
{/section} {/section}
</table> </table>
</td> </td>
</tr> </tr>
@@ -78,7 +78,7 @@
<div style="float: left; margin-right: 25px"> <div style="float: left; margin-right: 25px">
<table class="iconlist"> <table class="iconlist">
{strip} {strip}
{foreach from=$lvData.page.criteria item=cr name=criteria} {foreach from=$lvData.page.criteria item=cr name=criteria}
<tr> <tr>
<th{if isset($cr.icon)} align="right" id="iconlist-icon{$cr.icon}"{/if}> <th{if isset($cr.icon)} align="right" id="iconlist-icon{$cr.icon}"{/if}>
{* for reference and standard entries *} {* for reference and standard entries *}
@@ -101,19 +101,16 @@
<div style="float: left"> <div style="float: left">
<table class="iconlist"> <table class="iconlist">
{/if} {/if}
{/foreach} {/foreach}
{/strip} {/strip}
</table> </table>
</div> </div>
{strip}
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{foreach from=$lvData.page.icons item=ic} {foreach from=$lvData.page.icons item=ic}
ge('iconlist-icon{$ic.itr}').appendChild({$ic.type}.createIcon({$ic.id}, 0, {if isset($ic.count) && $ic.count > 0}{$ic.count}{else}0{/if})); ge('iconlist-icon{$ic.itr}').appendChild({$ic.type}.createIcon({$ic.id}, 0, {if isset($ic.count) && $ic.count > 0}{$ic.count}{else}0{/if}));
{/foreach} {/foreach}
//]]></script> //]]></script>
{/strip}
<div style="clear: left"></div> <div style="clear: left"></div>
@@ -122,13 +119,13 @@
<h3>{$lang.rewards}</h3> <h3>{$lang.rewards}</h3>
{$lang.itemReward}<table class="icontab"> {$lang.itemReward}<table class="icontab">
<tr> <tr>
{foreach from=$lvData.page.itemReward item=i name=item key=id} {foreach from=$lvData.page.itemReward item=i name=item key=id}
<th id="icontab-icon{$smarty.foreach.item.index}"></th><td><span class="q{$i.quality}"><a href="?item={$id}">{$i.name}</a></span></td> <th id="icontab-icon{$smarty.foreach.item.index}"></th><td><span class="q{$i.quality}"><a href="?item={$id}">{$i.name}</a></span></td>
{/foreach} {/foreach}
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{foreach from=$lvData.page.itemReward item=i name=item key=id} {foreach from=$lvData.page.itemReward item=i name=item key=id}
ge('icontab-icon{$smarty.foreach.item.index}').appendChild(g_items.createIcon({$id}, 1, 1)); ge('icontab-icon{$smarty.foreach.item.index}').appendChild(g_items.createIcon({$id}, 1, 1));
{/foreach} {/foreach}
//]]></script> //]]></script>
</tr> </tr>
</table> </table>
@@ -138,9 +135,9 @@
{if $lvData.page.titleReward} {if $lvData.page.titleReward}
<h3>{$lang.gains}</h3> <h3>{$lang.gains}</h3>
<ul> <ul>
{foreach from=$lvData.page.titleReward item=i} {foreach from=$lvData.page.titleReward item=i}
<li><div>{$i}</div></li> <li><div>{$i}</div></li>
{/foreach} {/foreach}
</ul> </ul>
{/if} {/if}