Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages

www.blogsome.com Forum Index » Getting Started

Post new topic   Reply to topic
WPHacks/Smarty for Blogsome.com Goto page 1, 2  Next
View previous topic :: View next topic  
Author Message
diskawa



Joined: 13 Dec 2004
Posts: 22

PostPosted: Tue Dec 14, 2004 3:45 am    Post subject: WPHacks/Smarty for Blogsome.com Reply with quote

Hi, hej, hola, hallo, bonjour, ciao, zdravo!
I’m new here at Blogsome.com, and after a few hours I realized that this was exactly what i needed for my blogging. I came to the conclusion that there is a few restrictions when it comes to blogging here at Blogsome.com. So I wanted to contribute to the rest of community here with some helpful tips/tricks/hacks that work with your Blogsome.com account.

Many have noticed that WP Plugins is something that can be very useful to customize your blog, but Blogsome have only a few incorporated into their WP system, so there's no way you can add Plugins yourself for you blog. But there is a Plugin Category here in the forums where you can ask questions or maybe even request Plugins, Blogsome.com crew will look into it and see if that particular plugin is really needed and might even add it to the system.

What I wanted to talk about is the actual 'hacks' that you can use..
Many useful things can be found in WP Wiki, but the documentation over there is not completely correct for us Blogsome users..

Many times you will see codes that looks for example like this;

Code:
<?php list_cats(optionall, 'all', 'sort_column', optioncount); ?>


When in fact you should be more like this;

Code:
{list_cats optional='1' all='All' optioncount='1' sort_column='name'}


(the above is the tags to List the Categories in the Sidebar, but also turn the feature on for post counting.. amount of posts show next to the category name)

For a complete list of Template Tags go here: http://wiki.wordpress.org/?pagename=TemplateTags

Okay, so now we know that these Tags control the WP system, so lets list a few that might be useful.

Code:
 {list_cats optional='1' all='All' optioncount='1' sort_column='name'}

Displays the post count next to category.

WPWiki info on [b]list_cats[/b]: http://wiki.wordpress.org/?pagename=list_cats


Code:
 {get_archives type='monthly' show_post_count='1'}

Displays the post count next to Archive(month).

WPWiki info on [b]get_archives[/b]: http://wiki.wordpress.org/?pagename=get_archives


Code:
 {the_time d='D M d, Y'}

Displays (day month day, year) over each post. There's plenty of ways to display the different the_time tag, and you read more about them here; http://de2.php.net/date

WPWiki info on [b]the_time[/b]: http://wiki.wordpress.org/?pagename=the_time 


I've only used my Blogsome account for a few days, so I will update this list as I customize my own blog..
Please contribute if you have any more useful 'hacks'..


Last edited by diskawa on Wed Dec 22, 2004 2:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
john
Guest





PostPosted: Tue Dec 14, 2004 10:18 am    Post subject: Reply with quote

Many thanks for this diskawa. We really appreciate you taking the time to help new users.
Back to top
zheaton



Joined: 03 Dec 2004
Posts: 532
Location: United States

PostPosted: Sat Dec 18, 2004 8:25 pm    Post subject: WPHacks for Blogsome, Part II Reply with quote

The fact that tags are enclosed in curly brackets is a result of the fact that BlogSome uses the Smarty templating engine instead of a standard "raw PHP" layout mechanism.

The Smarty templating system is designed to separate the logic that lays out a page from the code that presents a page. On the upside, Smarty makes designing templates easier, and makes it harder to accidentally alter the logic that allows your page to display correctly. On the downside, the use of Smarty makes it difficult to make deliberate changes to the logic code in your page.

There are a few notable pitfalls to avoid when working with Smarty:

First, as previously mentioned, Smarty uses curly brackets "{}" to designate tags. If you want to include curly brackets in your page that are not interpreted by Smarty, such as those in JavaScript, you must surround them with a literal tag:

Code:
{literal} your code here {/literal}


Smarty will not attempt to interpret any code between literal tags. (Note that CSS files are not interpreted by Smarty, and do not need to be escaped.)

Secondly, it is not possible to directly insert PHP code into a Smarty template. It is also not possible for users to define new Smarty tags. (It is possible for administrators to define new tags if they so choose.) If you need to implement custom logic in your page (for example, an image rotator, it may be wisest to use JavaScript.

Finally, be aware that templates and designs for WordPress written in PHP may require some effort to convert to Smarty templates. A full list of default Smarty tags for WordPress 1.0 can be obtained online here. Alternately, you can download the latest release of WordPress and view the source of "class-smarty.php" under the directory "wp-includes." (Note that BlogSome is currently running an alpha version of WordPress 1.3 - I do not know what changes have been made between 1.0, 1.2.2, and 1.3 in "class-smarty.php," but this is a point to consider if you encounter unexplained difficulties working from the 1.0 or 1.2.2 source.)
_________________
I'm no longer a moderator - don't PM me with questions.

Search the forum, check the wiki, and ask smart questions
Back to top
View user's profile Send private message Visit poster's website
diskawa



Joined: 13 Dec 2004
Posts: 22

PostPosted: Sat Dec 18, 2004 8:58 pm    Post subject: Reply with quote

Thanks for the tips zheaton, I have a look into those links you posted, see if there's something that I can learn from.
Back to top
View user's profile Send private message
zheaton



Joined: 03 Dec 2004
Posts: 532
Location: United States

PostPosted: Sun Dec 19, 2004 5:42 am    Post subject: Reply with quote

Sounds good, diskawa - if you learn anything handy, please post here. Perhaps between the two of us and any other interested parties, we can come up with something approaching documentation.

Regards,
zheaton
_________________
I'm no longer a moderator - don't PM me with questions.

Search the forum, check the wiki, and ask smart questions
Back to top
View user's profile Send private message Visit poster's website
Itsuki



Joined: 09 Dec 2004
Posts: 22

PostPosted: Tue Dec 21, 2004 3:52 am    Post subject: Reply with quote

How about a Blogsome wiki?
Back to top
View user's profile Send private message Visit poster's website
diskawa



Joined: 13 Dec 2004
Posts: 22

PostPosted: Wed Dec 22, 2004 2:01 pm    Post subject: Reply with quote

Itsuki wrote:
How about a Blogsome wiki?


I dont see why not Smile


Smarty Tags available according to rogerg:

http://www.blogsome.com/forum/viewtopic.php?t=98
Back to top
View user's profile Send private message
lukeprog



Joined: 21 Dec 2004
Posts: 25

PostPosted: Wed Dec 22, 2004 5:02 pm    Post subject: Reply with quote

awesome, Thanks, diskawa.

I know diddly about coding PHP and such - would you (or someone) mind letting a newbie how to replace the header text with a header image linked to my blog's home page? As I did with my old blog: http://popthoughts.blogthing.com/
Back to top
View user's profile Send private message Send e-mail
diskawa



Joined: 13 Dec 2004
Posts: 22

PostPosted: Wed Dec 22, 2004 5:17 pm    Post subject: Reply with quote

lukeprog wrote:
awesome, Thanks, diskawa.

I know diddly about coding PHP and such - would you (or someone) mind letting a newbie how to replace the header text with a header image linked to my blog's home page? As I did with my old blog: http://popthoughts.blogthing.com/


Well it depends wich Template you're using...
Normally there's a <div="header"></div> in your template, and between the tags is the url/img as you have now.

Here's an example how a default templat looks like at blogsome;

Code:
<div id="header"><div id="headerimg"><h1><a href="{$siteurl}" title="{bloginfo show='name'}">{bloginfo show='name'}</a></h1><hr /></div></div>


This part is what you need to add to your own template;
Code:
<a href="{$siteurl}" title="{bloginfo show='name'}">{bloginfo show='name'}</a>


hope this helps
Back to top
View user's profile Send private message
lukeprog



Joined: 21 Dec 2004
Posts: 25

PostPosted: Thu Dec 23, 2004 4:08 am    Post subject: Reply with quote

Perhaps I'm a bit dense, but where would I add that code, and how would it help without leaving room for the URL of the image I want to display in the header?
Back to top
View user's profile Send private message Send e-mail
diskawa



Joined: 13 Dec 2004
Posts: 22

PostPosted: Thu Dec 23, 2004 4:35 am    Post subject: Reply with quote

lukeprog wrote:
Perhaps I'm a bit dense, but where would I add that code, and how would it help without leaving room for the URL of the image I want to display in the header?


Sorry I must've missunderstood your question...

This what it looks like now for example. It tells it to get the URL, Title, and between the Link tags u got {bloginfo show='name'} which will display the name of your blog as a hyperlink, (its between <a href="...">its here</a>)

Code:

<a href="{$siteurl}" title="{bloginfo show='name'}">{bloginfo show='name'}</a>


If i understadn you right, you would lie to remove the 'name' a place a image instead? Ok..

Remove {bloginfo show='name'} and add the url for your image, for example;

Code:

<a href="{$siteurl}" title="{bloginfo show='name'}"><img src="http://UrlToTheImage/myimage.jpg" /></a>


Which template are you using at the moment?
Back to top
View user's profile Send private message
lukeprog



Joined: 21 Dec 2004
Posts: 25

PostPosted: Thu Dec 23, 2004 6:35 am    Post subject: Reply with quote

Yes, that's what I was looking for!

I'm using the default template (Kubrick?).

However, the image is now appearing from the center of the 'blue' area, where the text title of my blog would appear. How do I get it to basically cover the blue area (assuming the image is the same size? I don't see any pixel positioning code in the template right now.

Right now, the full code looks like this, in case it's useful:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">  <head>   
<title>{bloginfo show='name'} {single_post_title prefix=' :: '}{single_cat_title prefix=' :: '}{single_month_title prefix=' :: '}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     
<meta http-equiv="imagetoolbar" content="no" />
<meta content="TRUE" name="MSSmartTagsPreventParsing" />
<meta name="generator" content="WordPress {$wp_version}" /><!-- leave this for stats -->
<style type="text/css" media="screen">
@import url( "{$siteurl}/templates/wp-layout.css" );
</style>   
<link rel="alternate" type="text/xml" title="RDF" href="{bloginfo show='rdf_url'}" />
<link rel="alternate" type="text/xml" title="RSS" href="{bloginfo show='rss2_url'}" />
<link rel="pingback" href="{bloginfo show='pingback_url'}" />
</head>
<body>
{comments_popup_script}
{insert name="getreferer"}


<div id="page">

<div id="header"><div id="headerimg"><h1><a href="{$siteurl}" title="{bloginfo show='name'}"><img src="http://tinypic.com/yo2fm" /></a></h1><hr /></div></div>
<hr />


   <div id="content" class="narrowcolumn">
      <p><img src="http://popthoughts.blogsome.com/uploads/popthoughts/popthoughts - seventh seal header.jpg" alt="Det Sjunde inseglet"></p>

      {$content}   
                  
   </div>
   




   <div id="sidebar">
      <ul>
         
         <li>
                  <form method="get" id="searchform" action="{$Smarty.server.PHP_SELF}">
         <input type="text" value="" name="s" id="s" />
         <input type="submit" id="searchsubmit" name="Submit" value="Go!" />

      </form>         </li></ul>

      
<ul><li id="archives"><h2>Archives</h2>
        <ul>
           {get_archives type='monthly' show_post_count='1'}
        </ul>
        </li></ul>
         <ul><li><h2>Categories</h2>
            <ul>
            {list_cats optional='1' all='All' optioncount='1' sort_column='name'}
            </ul>
         </li></ul>

                     
            <ul><li><h2>Links</h2>
               <ul>
                   {get_links category='-1' before='<li>' after='</li>' between='' show_images='0' orderby='_updated' show_description='0' show_rating='0' limit='-1' show_updated='-1'}
               </ul>
            </li></ul>
            
            <ul><li><h2>Admin</h2>
               <ul>
                  <li><a href="{$siteurl}/wp-login.php">login</a></li>
                  <li><a href="{$siteurl}/wp-register.php">register</a></li>
               </ul>
            </li></ul>
            <ul><li><h2>Meta:</h2>
                    <ul>
                       <li><a href="{bloginfo show='rss_url'}">RSS .92</a></li>
                       <li><a href="{bloginfo show='rdf_url'}">RDF 1.0</a></li>
                       <li><a href="{bloginfo show='rss2_url'}">RSS 2.0</a></li>
                       <li><a href="{bloginfo show='comments_rss2_url'}">Comments RSS 2.0</a></li>
                            <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>

               </ul>
            </li></ul>
            <ul><li>
                                <ul><li>{get_calendar}</li>
                                </ul>
                                </li></ul>
   </div>




<hr />
<div id="footer">
   <p>
   </p>
</div>
</div>
<!--
####################################################
####      Do Not Remove         ####
-->
   <p class="credit">{$wordpressblogs}</p>
<!--
####      Do Not Remove         ####
####################################################
-->
</body>
</html>
Back to top
View user's profile Send private message Send e-mail
diskawa



Joined: 13 Dec 2004
Posts: 22

PostPosted: Thu Dec 23, 2004 3:27 pm    Post subject: Reply with quote

Check the StyleSheet...

Thats were all the positioning is... in Kubricks template you'll find the kubrickheader.jpg, which is the one you want to change.

Here's a link to the actual header (my testblog), make a copy of it and edit it with your image editor (photoshop etc...)

http://testblog.blogsome.com/wp-inst/wp-content/sitetemplates/kubrick/img/kubrickheader.jpg

I don't know how familiar you are with Css, but a tip would be to get a Css editor of some sort, In that case you can copy all the code and work on it locally Smile
Back to top
View user's profile Send private message
lukeprog



Joined: 21 Dec 2004
Posts: 25

PostPosted: Thu Dec 23, 2004 10:39 pm    Post subject: Reply with quote

Ah, okay. But now, how do I get access to my own kubrickheader.jpg and replace it with a modified copy? Because, there's apparently no FTP access for Blogsome, and no real file manager, besides an uploader in the web interface...

EDIT: Actually, no. Don't answer that Smile

Let me tinker around for a while, maybe try to learn CSS, see what I can do. I hate being a leech. Thanks for your help!
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Sat Dec 25, 2004 3:22 pm    Post subject: Reply with quote

you dont need ftp, just use the FileUploader, upload your header.jpg, copy the url and then replace the url in your template Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    www.blogsome.com Forum Index » Getting Started All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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