Does anyone here like the use of Smarty tags?

Discussion in 'Templates customization' started by webosb, Nov 30, 2004.

  1. webosb

    webosb Guest

    Does anyone even like how this script uses Smarty tags? Personally, I hate them. I was trying to alter the templates and I notice all the .html files uses smartytags. Why not just use good ol' .php files without smarty tags? I think this script is a bit overboard on securing the source codes rather than giving it the ease of use. I noticed that many people that use this script don't even alter the template. Everyone's pages look pretty much the same when it comes to Sign up, Login, Members area pages. Unless someone can tell me otherwise, I think smarty sucks.
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    webosb, I completely agree with you. Using smarty was a mistake, and we will avoid it in next projects (and future aMember Pro generations release will not have Smarty templates).
    However, I hope you understand it is not a quick change and won't be soon.

    Currently, I cannot believe it is a real problem to customize aMember Pro templates. Many users don't do it because they don't know what is CSS. Another kind of users just don't have time for all this. And there are lot of clients that customized templates very nice. Most of them are not programmers at all.
  3. jasondavis

    jasondavis New Member

    Joined:
    Aug 1, 2003
    Messages:
    85
    I think the templates are great and make use of them very often for new features and anything you can do in a php file you can do with smarty.
  4. webosb

    webosb Guest

    I mean dont get me wrong here. I think the script is great but the template system is a pain in the ass. CSS is great for creating layouts but when it comes to customizing the features to be displayed a certain way, It is confusing with smarty. For instance, I want the payment history to display on a seperate page, but since it requires something with members.php and whatever .inc.php file then it displays with the smarty tags. Why more work than it should be? A simply include('payment_history.php'); would be great. I think the script should just put alot of features into functions(); This script should be pure php driven. I had to read up on Smarty because I couldn't understand the tags.
  5. coeus

    coeus New Member

    Joined:
    May 31, 2005
    Messages:
    11
    ...

    Smarty is a great system. Alex, I think you shouldn't write it off your list, I think you guys just approached it wrong. There are better and easier ways to work with smarty, you may want to look at other scripts for reference. Especially from a programmer perspective, it's nicer to have design and code seperated, you just have to make sure when you're setting up smarty objects and functionality you keep that seperate from your core code as well, so creating a smarty.php file to keep all smarty related code is a start :)
  6. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Smarty is nice system, and it is really wrongly used in aMember. In any case, Smarty is useless on shared hosts because of permission problems. We have this resolved but with some performance penalty.

    New aMember will not use Smarty, we already have found a nice replacement: http://www.phpsavant.com/
  7. newuser

    newuser New Member

    Joined:
    Nov 30, 2004
    Messages:
    18
    Smarty is horrible.

    I'm spending hours trying to figure how how to do something very simple. I want to update a new database table when a member purchases a product.

    A little sql query - a little php and I'm done... but no.. .I've got to learn a whole new f*ing script language.

    Smarty sucks
  8. coeus

    coeus New Member

    Joined:
    May 31, 2005
    Messages:
    11
    ...

    The whole purpose of smarty is to separate code logic from design. If you want to do a DB query, then put it in the file that's loading the smarty template. The smarty template is only for displaying.
  9. newuser

    newuser New Member

    Joined:
    Nov 30, 2004
    Messages:
    18
    Yea... I know. I know what its for... I just don't think that creating a whole new scripting language to do it is the right way to go. What is so complicated about PHP... Smarty is no easier.

    Its a poor choice.
  10. Sergei

    Sergei aMember Pro Customer

    Joined:
    Mar 6, 2006
    Messages:
    96
    Alex, you know I use Phorum and that I am happy with it. It allows caching and it speeds up the script. I think I can say I am one of the users that get a lot of visitors and members on my scripts and I am happy. If you are going to change keep it based on Phorums system. Either way I am happy with the current system. Maybe to select templates would be nice but http://www.phpsavant.com/ is a mistake due to its licence. Smarty is easy and if you know PHP then you know how to work with Smarty. More and more scripts are switching to Smarty even Coppermine so it would be a bad idea to go a different direction. Using SMarty makes Amember flexible and allows it to be used with other scripts easier.
  11. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    1. First, you just write in smarty:
    PHP:
    {php}
    any your usualy php code here
    just don
    't forget to make variables global 
    because you are inside a function call
    {/php}
    2. Second, why would you update tables in template? It is great mistake. First, read this:
    http://www.amember.com/docs/html/creatingnewintegrationplugi.htm
    Or let me know what you need to do and I will suggest.
  12. Sergei

    Sergei aMember Pro Customer

    Joined:
    Mar 6, 2006
    Messages:
    96
  13. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    phpSavant is LGPL, so I can link it with my commercial script without any license problems.
    phpSavant is just simple PHP, so I belive it is easier to learn for most peoples and more HTML editors will understand it. Currently HTML editors often break strings inside smarty's {...}
    phpSavant is lightweight, and it is VERY QUICK.
    phpSavant does not need to compile and store any files - no more permissions problems on shared webhosting.

    If I would write a script for myself to used on my dedicated server - I would use Smarty without ever any thinking. However, it creates lot of problems on shared hosts. We have solved it, but price is performance.

    In any case, I appreciate your input, thank you very much!
  14. Sergei

    Sergei aMember Pro Customer

    Joined:
    Mar 6, 2006
    Messages:
    96
    I understand its quick, but I spend a lot of time creating a nice template and adjusting other scripts to smarty.....and the fact that more and more scripts are moving towards smarty might be an indication that shared hosts will resolve the issues. I have not run into any problems with the current system and you know that my previous host from Belgrade was a disaster.

    Either way, the product is good and I am happy so keep up the good work.
  15. joe_asto2

    joe_asto2 New Member

    Joined:
    Aug 22, 2006
    Messages:
    68
    having worked with awkward systems such as patTemplate in Joomla!, working with the smarty template system here in aMember is such a relief!

    Please don't remove smarty support. I'm sure changing to another system would alienate a huge number of current users.

    Thanks for all your hard work.
  16. sboben

    sboben New Member

    Joined:
    Oct 5, 2006
    Messages:
    48
    Well you guys are the techy folks - I don't get the Smarty stuff, but if aMember had a theme system like WordPress, I'd be making themes for everybody. There the theme is entirely independent of the code.

    I totally customized aMember for my site and I'm really going to be in a mess when it comes time to upgrade ack. But it had to be done. Please log my vote for something like WordPress. I could then make a whole business selling aMember themes! :)
  17. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Sboben, thanks for suggestion, we will review that and implement if possible.
  18. Sergei

    Sergei aMember Pro Customer

    Joined:
    Mar 6, 2006
    Messages:
    96
    I host a wordpress blog system. Its not really a template system they use, its more just plain php, I think people will not have an easier job. But if there is a demand for Amember templates I can make them easily. I was planning to open a Phorum template shop and also for PHP Nuke and some other scripts so I will add Amember to it. PM me for more info and I will soon activate the new domain. Maybe sboben and I can combine some efforts? Once you understand Smarty its easy and less tacky to template. Of course what also could be considered is to use something similar that Phorum uses, which allows both Smarty tags and PHP tags in templates.
  19. sboben

    sboben New Member

    Joined:
    Oct 5, 2006
    Messages:
    48
    Before running aMember I had not heard of Smarty templates - I still don't understand exactly what it is, but as I morphed my version of aMember to match my web site, I found that all of the layout and half the styles were still defined by the HTML, not the CSS. I've almost rewritten the entire template system using CSS at this point. Most table layouts were redefined using DIV tags and positioned using CSS.

    Now I use aMember not for subscriptions to content, but simply to ease the problem of getting software updates out to my customers. They buy templates from me for their web site application, iWeb, and I grant them access to the download areas. I post the files, any updates and many other supporting documents and imagery in the protected areas. It's outstanding in that respect and I think people love having their own "area" to keep their "stuff" too.

    But for me, the native page layouts of aMember weren't really fitting for the way I was using aMember. I totally rearranged my account page, well... as best I could. You can't really do much with those data tables, but I did manage to create a totally new look. You can view a screenshot here:

    http://11mystics.com/blog/2006/10/31/i-purchased-i-paid-wheres-my-stuff/

    What I would really like to see for aMember is a collection of "widgets" you just plug into your pages. So if I want to put the payment history widget on any given page, I simply just type:

    <?php get_paymentHistory(); ?>

    That's how WordPress would do it - they just call in the various pieces of data and any theme designer can put it on any page and style it any way they want. I think PHP and CSS is more well known and accessible to the design community so if you go this route, sign me up to start making themes!

    People love the system by the way. You've done a great job and your roadmap is just full of great potential. Keep up the great work.
  20. sboben

    sboben New Member

    Joined:
    Oct 5, 2006
    Messages:
    48
    Oh, P.S. I agree with Sergei that the person installing and running aMember won't have an easier time styling aMember using the WordPress method of theming. What I meant was, using the WordPress method would make it far easier for designers like me to generate themes for aMember.

    All the aMember owners would have to do then is download the theme, copy it to the server into the theme directory, enable the theme and the whole site is transformed.

    WordPress.org is nearing 100,000 theme downloads - people are familiar with that method and it's easy for nearly anyone to download them and use them with their system. When it's that easy, it really encourages theme development too and that would be another selling point for aMember... "huge selection of themes to choose from!"

Share This Page