Testimonials

Banner

Blog Tags

Lab Eleven Blogs

A short description about your blog

Will iPhone Apps Run On iPad?

Posted by: twmeier

Tagged in: SDK , iPhone , iPad

One big question that iPhone developers have about the iPad, is whether or not existing iPhone app will also work on the iPad. The answer to that question is YES. The iPad in many ways looks like a large iPhone, and in many ways it acts like one too.

The iPad can run all of Apple's iTunes App Store iPhone and iPod touchs apps. And, just like an iPhone, you can upload your existing apps, music, pictures, videos etc. to your iPad.

 When you run your apps in the iPad, you can choose to display them as their original iPhone size (320 x 480) or you can hit a 2x button on the screen and double the size. At 2x the original size, the app will not completely fill the screen. 


How to create a marquee text for an iPhone app

Posted by: twmeier

Tagged in: Programming , iPhone

In this blog, you will learn how to create a moving text field (also know as a marquee). Marquees are very convenient to show news, stock updates, sport scores etc..


In the .h file:
#import
@interface FirstViewController : UIViewController {

UIView *messageView;
UILabel *lblTime;
CGSize messageSize;
}
@end


In the .m file:

- (void)viewDidAppear:(BOOL)animated {    
NSString *theMessage = @"Hello, my name is Enigo Montoya. You killed my father, prepare to die";
messageSize = [theMessage sizeWithFont:[UIFont systemFontOfSize:14.0]];
messageView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, messageSize.width, 19)]; //x,y,width,height
[messageView setClipsToBounds:YES]; // With This you prevent the animation to be drawn outside the bounds.
[self.view addSubview:messageView];
lblTime = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, messageSize.width, 19)]; //x,y,width,height
[lblTime setBackgroundColor:[UIColor darkGrayColor]];
lblTime.font = [UIFont systemFontOfSize:14];
[lblTime setText:theMessage];
[lblTime setTextAlignment:UITextAlignmentLeft];
lblTime.frame = CGRectMake(0, 0, messageSize.width, 19); //x,y,width,height
[messageView addSubview:lblTime];
float duration = messageSize.width / 60; // This determines the speed of the moving text.
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:messageView cache:YES];
lblTime.frame = CGRectMake(-messageSize.width, 0, messageSize.width, 19); //x,y,width,height
[UIView commitAnimations];
}

Thats all there is too it. Check out the comments in the code for further clues on how it works.


How to Submit Additional Images in Virtuemart

Posted by: twmeier

Tagged in: Joomla , Components

Adding a singe image to a product is easy. Adding additional images can be confusing.

To add additional images to a product, find your product in the Product list in the backend of your website.

 In the "Media" column, you will see a small icon. Click this icon. On the next page, you will be able to add more images to the product. You can also add other types of media such as a PDF.

That is all there is to it.


Using an Image as a Submit Button in HTML

Posted by: twmeier

Tagged in: Javascript , HTML

There are times when you want to use an image as a button to submit a form. One case is when you need to use JavaScript to check the html form was submitted correctly. Here is the code:

<script>
    function checkForm()
    {
        var msg = "Please correct the following: \n\n";
        var error = false;
       
        if(document.formName.elementName.value=="") {
            msg += "You must enter a date.\n";
            error = true;
        }
       
        if(error){
            alert(msg);           
        }else{
            if(confirm("Are you sure you want to submit this form?")){                                               
                document.formName.submit();       
            }                   
        }
    }
</script>

<form name="formName" action="/index.php?&task=something" method="post">
    <input type="text" name="elementName" id="elementId" value="">
    ....
</form>


<a href="#" onclick="checkForm(); return false;"><img src="/images/brown_submit.jpg" /></a>


The method above works in all browsers, and is easy to use. When you click the image, the JavaScript function is called. If there are no errors in the form, the function submits the form. Its that easy.


Quick and Easy SEO (Search Engine Optimization)

Posted by: twmeier

Tagged in: SEO

There are a few quick and easy ways to improve your website's search engine rankings using a few simple search engine optimizations. By following the simple steps below, you should see an increase in your rankings with the top search engines.

1). Never register your domain for only one year at a time
. Search engines will pick up on this and will assume your website may not be around for the long haul. There is not a specific number of years you should register your domain, but the more the better.

2). Pick your page titles wisely. Search engines seem to weigh heavily on page titles. Especially Yahoo. Pick page titles that match the keywords you would like focus on. I would recommend using Google's keyword tool to find the keywords that people are searching for the most that are relevant to your website:
https://adwords.google.com/select/KeywordToolExternal

3). Content is everything. Search engines now focus on content more then ever before. You need to start writing. All those English classes you took over the years will finally pay off. Again, you need to pick keywords you would like to focus on, and write your articles with using these keywords in the title, meta tags and the articles themselves.

If you do not have the time to write articles (or just hate to do so), you can easy find companies online that will do it for you. Most one page articles will cost you around $12 to $15. All you do is specify the subject and what keywords you would like them to include. For a small fee, these same companies will also post messages on your forum in order to get things moving.

4). Pick to use www or not to use www.
I recently checked the page rank of the homepage of one of my own personal website, first with 'www' in the url, and then without 'www'. I was surprised to find that the page ranks were different. Google was seeing the homepage as two unique pages, one with 'www' and one without. This is a problem since Google penalizes pages with duplicate content. To fix this problem you can place the following code in a file named ".htaccess" in your site's root directory:

Example 1 - Redirect domain.com to www.domain.com

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

Example 2 - Redirect www.domain.com to domain.com

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

5). Avoid the cheats
. A few months back, I actually heard these world: "I am going to throw some hidden text in my site for SEO." I almost died laughing. This may have worked 10 years ago, but not anymore. You will actually be punished for doing this. Just remember, if it seems to easy to work, it is. It will take a lot of work getting to the top of search engines. Just be patient.


Joomla 1.5 Database Functions

Posted by: twmeier

Tagged in: Programming , PHP , Joomla

Sometimes it may be hard to know how to best use Joomla's database class. Here are just a few of the most used database functions.

In Joomla 1.5, include the following line of code inside your php:

<?php
     $database  =& JFactory::getDBO();
?>

Use the $loadObject function when you want to retrieve one row from the database. For example:

$database->setQuery("SELECT * FROM jos_comprofiler WHERE id=125");
$userDetails = $database->loadObject();

You can now access the values as follows:

$userDetails->firstname
$userDetails->lastname
.....

If you want to retrieve more than one row from the database, use the loabObjectList() function. For example:

$database->setQuery("SELECT * FROM jos_comprofiler WHERE id<125");
$userDetails = $database->loadObjectList();

You will now have an array of objects. You can access the values as follows:

$userDetails[0]->firstname
$userDetails[0]->lastname
$userDetails[1]->firstname
$userDetails[1]->lastname
.....

If you want to retrieve a single value from the database, use the loadResult() function. For example:

$database->setQuery("SELECT COUNT(*) FROM jos_comprofiler");
$count= $database->loadResult();

You now have a regular php variable. In this case $count.

There are other Joomla database functions, but these three are the most common.


Changing a New Line to a Break

Posted by: twmeier

Tagged in: PHP

There is a great php function takes a variable and changes the  new lines (\n) into breaks (<br/>).

For example, a user submits a form on your website and used a textarea to submit a couple of paragraphs. You then retrieve this data from the database and echo it out in html. You will notice that it is now just one big paragraph.

To fix this problem, you the function: nl2br

Here is how you might use this:

<?php
     $paragraphs = nl2br($paragraphs);
     echo $paragraphs;
?>


How to Open a Link in a New Window.

Posted by: twmeier

Tagged in: HTML

Opening a link in a new window is very easy. A link in HTML looks like this:

<a href="someurl.com">Link Text</a>

To open the link in a new window add target="_blank":

<a href="someurl.com" target="_blank">Link Text</a>

If you are using a text editor to create you links, you will often times see the option to open the link in a new window.

Embedding Videos in Joomla Content

Posted by: twmeier

Tagged in: Plugins , Joomla

Embedding videos inside your Joomla content is easy. There are several Joomla plugins that make it a snap.

The plugin I would suggest is called the AllVideos (by JoomlaWorks), and can be downloaded for free at www.joomla.org.

Once you have installed the plugin, you will need to enable it by going to the "Plugin Manager" in the backend of your Joomla site (/administrator).

Below are some of the plugins features:

1. Dozens of video providers supported, including localized versions of YouTube and Google Video (e.g. es.youtube.com).
2. Stream your own media content, using the most popular video or audio formats for the web (flv, swf, mov, mp4, wmv, wma, mp3, 3gp, divx). You can even use high-definition videos!
3. Easily embed your media content either directly from your server or a remote server!
4. Simple controls inside the plugin's parameters page provide layout consistency on all the videos shown in your Joomla! website. Set your preferences in seconds, publish the plugin and you're ready to start streaming content!
5. Easy, descriptive syntax for media embedding - {format/provider}filename{/format/provider}. You can also use syntax like {format/provider}filename|width|height{/format/provider} (e.g. {youtube}he73js822|600|450{/youtube}) to display videos at different dimensions!
6. Skinnable! AllVideos uses CSS templates to wrap the players, we provide 2 to get you started.

Basically to use this plugin, you must first install and enable it in the backend of you Joomla website (/administrator), then you would simply insert the curly bracket text into your content.
This does not need to be done in HTML, and can simply be text.

To embed an FLV file directly into your content, you would simple upload the video to the folder that the plugin has designated (by default it is images/stories/videos), and use the following text: 
{flv}btodd09|500|400|true{/flv}

From this example, you will notice that you do not need to include the .flv extension. You will also notice that the width and height are determined by the 500 and 400 respectively. By adding "|true", you will can also automatically start your video.

You can get more information on how to use the plugin at their website:
http://www.joomlaworks.gr/content/view/35/41/


Modifying Page Title, Keywords and Description

Posted by: twmeier

Tagged in: SEO , Joomla

Modifying the page title, keywords and description for a page created by a component  in Joomla is very simple.

Inside your component, add the following:

<?php
global $mainframe;
$mainframe->SetPageTitle("Some Page Title");
$mainframe->appendMetaTag( "description", "Some Description.");
$mainframe->appendMetaTag( "keywords", "keyword1, keyword2");
?>

It is that simple.


<< Start < Prev 1 2 3 Next > End >>

Latest Blogs

Custom Rack Shelves
Aug 9th 2011 by: Administrator

Utah Criminal Defense Attorneys
Aug 8th 2011 by: Administrator

Oil Storage Tanks Customization
Aug 5th 2011 by: Administrator

The Best Hotel Near or Around Salt Lake City
Aug 1st 2011 by: Administrator

Salt Lake City Divorce Attorney
May 18th 2011 by: Administrator

Read all blogs