Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

I cannot post!!

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
xprt007
Smarty Rookie


Joined: 02 Feb 2011
Posts: 5

PostPosted: Wed Feb 02, 2011 3:27 pm    Post subject: I cannot post!! Reply with quote

I am try to post a question but on submission or preview, I keep getting the message, the topic I'm requesting does not exist.
This is ridiculous.

The post consists of questions, with several bits of php/smarty code & quoted text using the tools in this text editor!!

What sort of text gets blocked????
Quite surprised this particular message gets accepted
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Feb 02, 2011 4:26 pm    Post subject: Reply with quote

the spam filter sometimes gets a false positive, usually when a URL is in the text.
Back to top
View user's profile Send private message Visit poster's website
xprt007
Smarty Rookie


Joined: 02 Feb 2011
Posts: 5

PostPosted: Wed Feb 02, 2011 4:36 pm    Post subject: Reply with quote

Hi

I tried to break down the post, and tried a new post beginning with the introductory text, which was ok.
When I added a some longish piece of php/smarty code, which I had a question about, I got that response & when I tried to preview. I had put it between the code tags in the editor.

So I wonder if there is another way to go about this.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Feb 02, 2011 4:40 pm    Post subject: Reply with quote

use pastebin.com or pastie.org to post the code to and provide a link to that.
Back to top
View user's profile Send private message Visit poster's website
xprt007
Smarty Rookie


Joined: 02 Feb 2011
Posts: 5

PostPosted: Wed Feb 02, 2011 5:03 pm    Post subject: Some help urgently needed to obsfuscate email fields Reply with quote

Hi,

For some reason, I could not make post here, possibly because of some its contents. I was advised to post it at pastiebin.

Here is the link to the question: http://pastiebin.com/?page=p&id=4d493a9c29aed

Kind regards
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Feb 02, 2011 5:16 pm    Post subject: Reply with quote

If you are just looking for a way to obfuscate email addresses:

Code:
{mailto address=$EmailAddress encode='javascript' subject='Hello'}


http://www.smarty.net/docs/en/language.function.mailto.tpl
Back to top
View user's profile Send private message Visit poster's website
xprt007
Smarty Rookie


Joined: 02 Feb 2011
Posts: 5

PostPosted: Wed Feb 02, 2011 5:42 pm    Post subject: Reply with quote

Hi

No, emailing involved.
This is a normal web page of a web directory with websites & showing some contact & location information.
All submitted info is printed, it's just that the ALREADY AVAILABLE emails need to be obfuscated on that page.

view-listings.tpl has the code that prints that info.
The variables involved are {$listing.email} & {$listing.email2} ...
but the problem is how to them work with the obfuscation code

Code:
<?php
header("Content-type: image/png");
// Your email address which will be shown in the image
$email    =    "you@yourdomain.com";
$length    =    (strlen($email)*8);
$im = @ImageCreate ($length, 20)
     or die ("Cannot create new GD-Bild-Stream");
$background_color = ImageColorAllocate ($im, 255, 255, 255); // White: 255,255,255
$text_color = ImageColorAllocate ($im, 55, 103, 122);
imagestring($im, 3,5,2,$email, $text_color);
imagepng ($im);
?>


...

Someone mentioned only bits of how he did it:


Quote:
just a thought:

you could append the value of $listing.email to your scriptname.php
=> scriptname.php?email={$listing.email}

in your scriptname.php you could assign the submitted email to your email variable, f.ex

PHP Code:
<?php
header("Content-type: image/png");
// Your email address which will be shown in the image
$email = $_GET['email'];
where $_GET['email'] comes from the ?email={$listing.email}.

Tested and works (see image)


The problem is HOW.

I have no php/smarty experience.
--------
----------view-listings.tpl-----------

Code:
{include file="header.tpl" css="js/jquery/plugins/prettyphoto/css/prettyPhoto"}

<h1>{$listing.title|escape:"html"}</h1>

{include file="notification.tpl"}

<div class="box">
   <table cellpadding="2" cellspacing="0" width="100%">
   <tr>
      {if $config.thumbshot}
         <td valign="top" style="padding-right: 5px; width: 125px;">
            <div class="preview">
            {if isset($listing.$instead_thumbnail) and $listing.$instead_thumbnail neq ''}
               <img src="{$smarty.const.ESYN_URL}uploads/{$listing.$instead_thumbnail}" />
            {else}
               <img src="http://open.thumbshots.org/image.pxf?url={$listing.url}" alt="{$listing.url}" />
            {/if}
         </div>
         </td>
      {/if}
      <td valign="top">
         <table cellpadding="0" cellspacing="0" width="100%">
         <tr>
            <td style="width: 7.8em;"><strong>{$lang.title}:</strong></td>
            <td><a href="{$listing.url}" id="l{$listing.id}" {if $config.new_window}target="_blank"{/if}>{$listing.title}</a></td>
         </tr>
         <tr>
            <td><strong>{$lang.category}:</strong></td>
            <td>
               {if is_array($category.path)}
                  {foreach from=$category.path item=cat name="categpath"}
                     <a href="{print_category_url cat=$cat}">{$cat.title}</a>
                     {if not $smarty.foreach.categpath.last} / {/if}
                  {/foreach}
               {else}
                  <a href="{print_category_url cat=$category}">{$category.title}</a>
               {/if}
            </td>
         </tr>

         <!-- Display crossed categories modification
         {if isset($crossed_categories) && !empty($crossed_categories)}
            <tr>
               <td><strong>{$lang.crossed_to}:</strong></td>
               <td>
                  {foreach from=$crossed_categories item="crossed_category" name="crossed_category"}
                     <a href="{print_category_url cat=$crossed_category}">{$crossed_category.title}</a>
                     {if not $smarty.foreach.crossed_category.last},{/if}
                  {/foreach}
               </td>
            </tr>
         {/if}
         -->

         <tr>
            <td><strong>{$lang.clicks}:</strong></td>
            <td>{$listing.clicks}</td>
         </tr>
         <tr>
            <td><strong>{$lang.listing_added}:</strong></td>
            <td>{$listing.date|date_format:$config.date_format}</td>
         </tr>
         
         {if $config.pagerank}
         <tr>
            <td><strong>{$lang.pagerank}:</strong></td>
            <td>
               {print_pagerank pagerank=$listing.pagerank}
            </td>
         </tr>
         {/if}

         {esynHooker name="viewListingAfterMainFieldsDisplay"}

         </table>
      </td>
   </tr>
   </table>

   {if $config.html_tags}
      {$listing.description|replace:"\r\n":"<br />"}
   {else}
      {$listing.description|escape:"html"|replace:"\r\n":"<br />"}
   {/if}

   {if $fields}
      {include file="box-header.tpl" caption=$lang.fields style="fixed"}

      {esynHooker name="viewListingBeforeFieldsDisplay"}

      <table cellpadding="2" cellspacing="0" width="100%">
      {foreach from=$fields item=field}
         {assign var="key" value=$field.name}
         {assign var="field_name" value='field_'|cat:$field.name}
         {if $listing.$key || ($listing.$key eq '0')}
         <tr>
            <td style="width: 20%;"><strong>{$lang.$field_name}:</strong></td>
            <td>
               {if ($field.type eq 'text') || ($field.type eq 'textarea') || ($field.type eq 'number')}
                  {if $config.html_tags}
                     {$listing.$key|replace:"\r\n":"<br />"}
                  {else}
                     {$listing.$key|escape:"html"}
                  {/if}
               {elseif $field.type eq 'checkbox'}
                  {assign var="values" value=','|explode:$listing.$key}
                  {if $values}
                     {foreach name="checkbox_iter" from=$values item=field_val}
                        {assign var="lang_key" value="field_"|cat:$field.name|cat:"_"|cat:$field_val}
                        {$lang.$lang_key}{if !$smarty.foreach.checkbox_iter.last},&nbsp;{/if}
                     {/foreach}
                  {/if}
               {elseif $field.type eq 'storage'}
                  <a href="{$smarty.const.ESYN_URL}uploads/{$listing.$key}">{$lang.download}</a>
               {elseif $field.type eq 'image'}
                  {assign var="image_name" value="small_"|cat:$listing.$key}
                  {assign var="image_path" value=$smarty.const.ESYN_HOME|cat:"uploads"|cat:$smarty.const.ESYN_DS|cat:$image_name}

                  {if $image_path|file_exists}
                     <a href="{$smarty.const.ESYN_URL}uploads/{$listing.$key}" target="_blank" class="lightbox">{print_img ups=true full=true fl=$image_name alt=$listing.$key}</a>
                  {else}
                     <a href="{$smarty.const.ESYN_URL}uploads/{$listing.$key}" target="_blank" class="lightbox">{print_img ups=true full=true fl=$listing.$key alt=$listing.$key}</a>
                  {/if}
               {elseif $field.type eq 'pictures'}
                  {assign var="images" value=","|explode:$listing.$key}

                  {foreach from=$images item=image}
                     {assign var="image_name" value="small_"|cat:$image}
                     {assign var="image_path" value=$smarty.const.ESYN_HOME|cat:"uploads"|cat:$smarty.const.ESYN_DS|cat:$image_name}

                     {if $image_path|file_exists}
                        <a href="{$smarty.const.ESYN_URL}uploads/{$image}" rel="prettyPhoto[gal]">{print_img ups=true full=true fl=$image_name alt=$image}</a>
                     {else}
                        <a href="{$smarty.const.ESYN_URL}uploads/{$image}" rel="prettyPhoto[gal]">{print_img ups=true full=true fl=$image alt=$image}</a>
                     {/if}
                  {/foreach}
               {elseif $field.type eq 'combo'}
                  {assign var="field_combo" value="field_"|cat:$field.name|cat:'_'|cat:$listing.$key}
                  {$lang.$field_combo}
               {elseif $field.type eq 'radio'}
                  {assign var="field_radio" value="field_"|cat:$field.name|cat:'_'|cat:$listing.$key}
                  {$lang.$field_radio}
               {/if}
            </td>
         </tr>
         {/if}
      {/foreach}
      </table>

      {esynHooker name="viewListingAfterFieldsDisplay"}

      {include file="box-footer.tpl"}
   {/if}

   {esynHooker name="tplFrontViewListingBeforeDeepLinks"}

   {if $listing._deep_links}
      {include file="box-header.tpl" caption=$lang.quick_links style="fixed"}
         {foreach from=$listing._deep_links item=t key=u}
            <a href="{$u|escape:"html"}">{$t|escape:"html"}</a>&nbsp;<br />
         {/foreach}
      {include file="box-footer.tpl"}
   {/if}
</div>
{include_file js="js/jquery/plugins/prettyphoto/jquery.prettyPhoto, js/frontend/view-listing"}

{esynHooker name="viewListingBeforeFooter"}

{include file="footer.tpl"}
?>
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Feb 02, 2011 7:17 pm    Post subject: Reply with quote

Here is an example of obfuscating an email address, both in a URL and printed to the screen as a link:

Code:
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>


So for you:

Code:
{$listing.email|escape:"hexentity"}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP