Monday, July 27, 2009

problem solved

after weeks of trying to figure out how to get the image in a field from p4a displayed, i finally figured it out. in p4a there are two folders, an uploads folder which contains a tmp folder. when the image is uploaded, it is supposed to put the image in the tmp folder then in the uploads folder.

my problem was that the images were only going in the tmp folder and not in the uploads folder. so after numerous nights, i finally stayed up and was determined to make it work before i went to bed and that i did. it was alot of work but it payed off. i now know why it happened and how to fix it.

after reading the forum and different posts several times, with the toolbar, it does the moving of the image on saveRow(). I had created my own field and therefore wasnt using the save button on the toolbar. so i had to intercept the field when i was doing the save to the db and move the file myself.

the code is posted below:

$filename = $this->newProductImage->getNewValue();
$uploaded_tmp_filename = P4A_UPLOADS_DIR.$this->newProductImage->getNewValue(1);
$uploaded_filename = P4A_UPLOADS_DIR."/".$this->newProductImage->getNewValue(0);

$sequence = $this->imageSequence->getNewValue();
$product_id = $this->dbSourceProduct->fields->oid->getNewValue();

if( file_exists( $uploaded_tmp_filename ) ) {

$sql = "
insert into Image
values ('', '$filename', $sequence, $product_id);
";//exit;
if( P4A_DB::singleton()->query( $sql ) ){
if(!copy( $uploaded_tmp_filename, $uploaded_filename )){
$this->showMessage( "Error uploading file", "error" );
} else {
$this->showMessage("Image was successfully added", "applied");
//$this->doRefreshOriginalPage();
}
}else {
$this->showMessage("Image was not added", "error");
}
} else {
$this->showMessage("File not uploaded", "error");
}

Wednesday, July 22, 2009

sql string replace

this is an example of the sql string replace function

update tableName set
columnName = REPLACE(columnName, substr(columnName, 8, 7),'newStringValue');

Thursday, July 16, 2009

michaels jackson's hair on fire



this is the video from cnn with michael jackson's hair on fire. i guess that this prompted him to start wearing the wig

Wednesday, July 15, 2009

michael jackson and his skin disorder



well, he, michael, has said it on oprah and i think that it is conclusive enough. its a learning lesson for me. as the girl said in the video, we have the tools to research what we want to find out, lets do that. dont just take what the media says, find out for ourselves.

Tuesday, July 14, 2009

Facebook driving mobile net usage

http://news.bbc.co.uk/2/hi/technology/8149652.stm

Bride's bouquet brings down plane

http://news.bbc.co.uk/2/hi/europe/8149910.stm

the michael jackson cover up pt2

the michael jackson cover up



i honestly will have to look at the scriptures and get the actual intended meaning of the passage. i dont know about the U.S.A being totally or apart of what would form the beast of the world. i guess the way to find out is if one knows alot about the U.S.A and and therefore match it with what the Bible says because the Bible would give a clear description of what the beast would be. i think i have some research to do.

Sunday, July 12, 2009

opening salution for cover letter

i have had the mind worrying problem of what to write for the opening salutation of a letter when the addressee is unknown. i found this link, hope it helps.

http://www.ego4u.com/en/cram-up/writing/business-letter/salutation

If you don't know the person's name:

There are several possibilities to address people that you don't know by name:

salutationwhen to use
Dear Sir / Dear Sirsmale addressee (esp. in British English)
Gentlemenmale addressee (esp. in American English)
Dear Madamfemale addressee (esp. in British English)
Ladiesfemale addressee (esp. in American English)
Dear Sir or Madamgender unknown (esp. in British English)
Ladies and Gentlemengender unknown (esp. in American English)
To whom it may concerngender unknown (esp. in American English)

Saturday, July 11, 2009

Exhortation on Psalm 46

Psalm 46

1.Refuge – a place that one can go to for coverage, safety, security, and comfort.
Strength – God's word, promises and the victories that He has helped you to win, can provide that spiritual, physical edge that you need to stand, complete a task or even to commit acts of devotion to God; going to church and reading His words.

God is indeed omni-present but the psalmist was reminding us that when in need of a saviour, He will be there. No matter what the situation is, God can and will come through for us. Remember, his timing is not our timing, but He will come through.

2 - 3. When we know that we know that our God will never leave or forsake us, no matter what is happening around us, that will not phase us. If the earth is falling apart, not saying we cant be human, we should remind ourselves of God's Word where He promises to take care of us.

4.The city of God, Jerusalem, had no rivers. The reference to a river illustrates the use of metaphor. The river would signify blessing, continuous flowing, outpouring of blessing in the city of God.

5.Indeed, God dwells in this city. Just like anything or anyone else that belongs to God, he will protect us. So when nations try to attack, God will protect an help to overcome or win battles.

6.Ties in to verse 5 where no matter how many nations try to attack God's city, they will not win, they will fall. It shows the awesomeness of God. He will lift his voice and the earth will melt. Yes God is great and powerful and if He wants he can lift His voice and melt the earth but in this passage, it suggest that He will use His power as an act to frighten or scare those that try to harm us. Him doing that suggests His anger against the enemies of His children.

7.Showing these acts will prove that God was, is and will be with His children and He will fight for us.

8.This is an invitation to see the victories that God has won and how He showed His anger towards the enemies of his children.

9.He will stop all attacks on His children. The breaking of the bow and shattering of spears suggest the use of them no more. If nations have no weapons, they can be no war. This would/will lead to peace on earth.

10.After all is said and done, it will be seen and known that God, the God of our salvation has done it; has helped us to win battles and overcome fears. For this reason, we as His people must praise Him. We must show our gratitude to Him by giving Him praise.

11. In conclusion, remember that God is all around us, looking out and protecting us. He has protected us from things unknown to our eyes. We need not forget it. He is our help, provider, everything. Amen.

Sunday, July 5, 2009

NECROPHILIA......

A man was brought before the judge and charged with Necrophilia (making love to a dead woman).
The judge told him, 'In 20 years on the bench, I've never heard such a disgusting, immoral thing'.
Just give me one good reason why I shouldn't lock you up and throw away the key!'

The man replied, 'I'll give you THREE good reasons:
1. It's none of your damn business.
2. She was my wife; and.....
3. I didn't KNOW she was dead, she ALWAYS acted that
way!'


So ladies try to move a little during the game.

device to monitor your use of electricity

http://www.dintz.com/in-depth-save-money-by-tracking-your-electricity-use/

is this really what jamaicans do when they know or see tourists coming to them?

Friday, July 3, 2009

just saw this video and it excited me ;)

for all you who dont know, i love live music!!!!!!!

check out the drummer!!!!!! he is lost in his own little world


Last video of Michael Jackson Ever!!!!!!!!!!!!

Check it out.







him neva look like him did really inna it doe. :(