ADD показ доп. информации по платным точкам только по запросу, но пока отключено; регистрация переходов с доп. информации через go-away

This commit is contained in:
Krivchikov Dmitry 2016-01-07 16:07:47 +03:00
parent 6ba76ab818
commit 7388643a15
2 changed files with 23 additions and 8 deletions

View File

@ -99,7 +99,7 @@ class Helper
static function replaceUrls($string) static function replaceUrls($string)
{ {
$pr = '((https{0,1}:\/\/[\da-z\.-]+\.[a-z]{2,6})([\/\w\?=&#%+,-]|(\.[^\s]))*\/?)'; $pr = '((https{0,1}:\/\/[\da-z\.-]+\.[a-z]{2,6})([\/\w\?=&#%+,-]|(\.[^\s]))*\/?)';
$rep = '<a href="$0" title="Ссылка откроется в новом окне" target="_blank">$0</a>'; $rep = '<a href="/go/away/?url=$0" title="Ссылка откроется в новом окне" target="_blank">$0</a>';
return preg_replace($pr, $rep, $string); return preg_replace($pr, $rep, $string);
} }

View File

@ -81,13 +81,20 @@ $index = 0;
<th colspan="2">Дополнительная информация:</th> <th colspan="2">Дополнительная информация:</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($extraParams as $extraParam) { <?php foreach ($extraParams as $extraParam) {
print '<tr>'; print '<tr>';
print '<td>'.$extraParam->name.'</td>'; print '<td>'.$extraParam->name.'</td>';
print '<td>'. Helper::replaceUrls($extraParam->value).'</td>'; if(false && $point->isPaid()) {
print '</tr>'; print '<td>';
} print '<span id="extraHolder'.$extraParam->id.'" class="extraHolder" onclick="showExtraParam('.$extraParam->id.')" style="display: block;">'.mb_substr($extraParam->value, 0, 5, 'UTF-8').'… <span class="glyphicon glyphicon-chevron-right"></span></span>';
?> print '<span style="display: none;" id="extraData'.$extraParam->id.'" class="extraData">'.Helper::replaceUrls($extraParam->value).'</span>';
print '</td>';
} else {
print '<td>'.Helper::replaceUrls($extraParam->value).'</td>';
}
print '</tr>';
}
?>
</table> </table>
</div> </div>
<?php endif; <?php endif;
@ -172,3 +179,11 @@ $index = 0;
<!--googleon: all--> <!--googleon: all-->
<?= self::renderPartial('randomPoint.php', array('randomPoint'=>$randomPoint), true)?> <?= self::renderPartial('randomPoint.php', array('randomPoint'=>$randomPoint), true)?>
</div> </div>
<script>
function showExtraParam(id){
// $('#extraHolder'+id).hide();
// $('#extraData'+id).show();
$('.extraHolder').hide();
$('.extraData').show();
}
</script>