Posts tagged PHP
How to add a Webslice
1
It is very nice and user-friendly to have Webslices on your website. It improves the user experience by allowing visitors to be up to date with the latest content that you provide, assuming that it is fitted to this presentation style. Since my BNR exchange rates page was this kind, I pursued in adding a Webslice especially for it.
Adding a webslice to your website is simple. After you read the main specifications or my previous article, you’ll understand the concept behind: first you signal to the browser that you have a special part of your website by setting to a container element the class “hslice”:
<div id="BNRExchange" class="hslice">
<div style="display: none" class="entry-title">
<img id="image" alt="Radu Poenaru's weblog gives you BNR Exchange rates" src="http://www.radupoenaru.com/bnr/images/radupoenaru.jpg" width="128" height="128" />
<p>
Cursul oficial BNR
</p>
</div>
<p>
<a style="display: none" href="http://www.radupoenaru.com/bnr/bnr.php" rel="entry-content">
<a style="display: none" href="http://www.radupoenaru.com/bnr/bnr.php" rel="Bookmark" target="_blank">
<span style="display: none" class="ttl">5</span>
</p>
<div id="updateTrigger" class="entry-content" runat="server" />
........ your content that you want surrounded by the green webslice part ..............
</div>
Add Webslice to your website
1
You might ask: what is a Webslice? It is a chunk of information, allowing you to stay up-to-date with the latest news without actually needing open a website. They are added to special toolbars (special because they usually require a specific version of a browser, like IE 8). But otherwise, the content inside itâ??s just plain old HTML. When a WebSlice is added to the toolbar, it will be represented as a clickable drop-down area, allowing you to click on it and then see a specially designed small-scale version of the website. For example, my website provides a webslice for BNR exchange rates , allowing you to keep up with latest information available.
Usually, while hovering to an area webslice-enabled, the browser will show a specific icon â?? developed by Microsoft and symbolizing this technology. There are few design guidelines that you need to follow, quoted from Microsoft website :
WordPress – How to Delete Existing Post Revisions
0
This is the second part of managing WordPress feature of post revisions, for the users who had disabled or turned off post revisions tracking or versions history feature. As you already know, this feature exists in WordPress (starting with WordPress 2.6). After disable it (of course, if you really need to do that), it also make sense to also delete and remove all existing stored post revisions. By doing so, you’ll remove changes made on pages stored in the database such that you’ll slim down the wp_posts table size´. This is especially recommended when there is already lots of revisions or changes inside.
WordPress – managing Post Revisions Tracking
1
A very interesting feature added in WordPress blog publishing system since version 2.6 is the post revisions tracking, like in version control systems. It simply adds a Wiki-like style tracking of edits that had been made to the posts or pages. This allows bloggers and authors to view, control and moderate – knowing who and when made what changes to any post or page. It also includes the ability to compare for differences between each saved versions, or revert back to older version.
SyntaxHighlighter – how to use it and brushes available
0![]()
The brushes used by SyntaxHighlighter are in separate syntax files named brushes. The following can be used to format the <pre class=”brush: brushname”> that you want to use.
Brushes () in alphabetical order:
| Brush name | Brush aliases | File name |
|---|---|---|
| ActionScript3 | as3, actionscript3 | shBrushAS3.js |
| Bash/shell | bash, shell | shBrushBash.js |
| C# | c-sharp, csharp | shBrushCSharp.js |
| C++ | cpp, c | shBrushCpp.js |
| CSS | css | shBrushCss.js |
WordPress- how to implement Syntax Highlighting
1
Some while ago, I started publishing code on this website. On that days I used the free WordPress webhosting. But I wasn’t content with the representation of it. After some time, I moved my site to a payed hosting, where I could implement any plugin that I liked.
How to create an favicon.ico and improve your website
1As a business card represents your business or your position in it, the same applies to a website. By using a Favicon to you will improve your website personalization and when users will bookmark you, the picture will always remember them about you. Thus, the favicon is critical to it’s identity.
We might consider the favicon placed in a website is like your photo in your ID Card. As the photo enhances the chances that people identifies you, they can identify also your site by a favicon. But you have a unique one in order to not be confused with someone else. In this article I’ll help you on how you can add a favicon to your website in general or on WordPress blog in particular. (more…)
BNR exchange rate
0
In this global crisis, nothing is more useful than a good chart to watch your money as investment. That’s why I created a special page which collects freely available exchange rates from BNR (National Romanian Bank) and presents them in a graphical form. This way, the viewers of my website will always be on the edge with exchange rates, as soon as BNR posts them (usually around 13:00 GMT+2).
The main challenges were:
- Building a php script to parse XML, inserting the exchange rates into database. The lack of experience and debugging tools made a huge difference in development time. But all is working now.
- Creating a php script that will daily update the exchange rates, so the users will have the fresh rates at their disposal as soon as possible.
- Design the page that hosts the chart and provide create the appropriate data structure which will feed the chart with data.
- learn to use a very interesting framework of representing data as charts – Google Visualisations
Next steps:
- Offer the posibility to choose among all 30 currencies for which the BNR provides exchange rates.
- implement AJAX for smooth behavior of refreshing the page while user chooses a different currency.
Enjoy!
cPanel: using Cron Jobs
0
First – what is a cron job? It is a piece of software which can be run at specific times by the cron service. By example, one could set a cron job to update his application exchange rates from a server every day at a specific hour so its application will be up to date.
I used it because the Romanian National Bank doesn’t have a proper page to check for exchange rates – they present just the numbers, but no trends, no charts – nothing visual. Too bad for them! For me it is actually a good way to refresh my PHP / MySQL and apache management skills. Because this Cron stuff is actually new for me, I composed a small tutorial in order to be easy for me to remember and for you, my dear readers, to get quickly the information required for a quick start. So let’s get going with our ..
Cron Jobs quick Tutorial
Google Visualizations
0While working on my idea of presenting on this website also the Romanian National Bank exchange rates (very useful in this crisis time), I end up in choosing a form of visualization.
One might argue that text is good enough, but for me frankly graphs and charts are the best. So I started looking on the internet for free and customizable charting tools.
From the plethora of choices on the web I will present just a few:
1. An interesting tutorial on how to build a chart of your own – it’s the easy way to get exactly what you need done as it should be. It is quite old, but still actual, as Macromedia MX programming is still supported in Adobe CS3
2. OpenFlashChart GWT Library – very interesting, free library and highly customizable. But it comes with a big drawback : it has approx 375 Kb .. quite big for my requirements.
3. Origamy Flash graph component – amazingly nice and costly . 99$ ..
4. Google visualization – free, fast, light and with a ton of settings. They have pies, tables, charts … with really lots of settings. The added traffic isn’t much … around 30 kb per graph ( and I measured biggest one – Annotated time line ).