Friday, January 21, 2011

How to add extra fields in joomla registration


Let’s come to my blog post title “How to add extra fields in joomla registration and profile”. I was searching for solution about this but most common solution was put extra fields as joomla user meta tag. So let me show you how you can add extra fields in joomla registration and profile changing core files. I have tried to change less as much as possible.
Note: all file paths are windows style!

LIST OF FILES NEED TO EDIT/TOUCH

libraries\joomla\database\table\user.php it’s the class file tor user table/user object
Let we need to put two extra fields like phone and website, let’s these fields as optional. So we need to initialize two var as string.
find the follow lines and then need to put before that any php programmer will get easily but I am trying to write for all!
1 /**
2 * @param database A database connector object
3 */
4 function __construct( &$db )
now put the follow lines before above lines or near line 116


1 /**
2 * some extra fields like name
3 *
4 * @var string
5 */
6 var $phone          = null;
7 var $website        = null;


Again,


Open,
libraries\joomla\libraries\joomla\user\user.php
After line 124, add the following code



1 /**
2  * some extra fields like name
3  *
4  * @var string
5  */
6 var $phone          = null;
7 var $website        = null;

Yes we are 50% done already.
Now use your phpmyadmin to add alter your user table. Please don’t ask me how to work with phpmyadmin


1 ALTER TABLE jos_users ADD phone varchar(255) DEFAULT '' AFTER password;
2 ALTER TABLE jos_users ADD website varchar(255) DEFAULT '' AFTER phone;



Please take care about your table prefix. my table prefix. If you table prefix is something else like mysite then your user table will be like mysite_users and the sql code will be like this

1 ALTER TABLE mysite_users ADD phone varchar(255) DEFAULT '' AFTER password;
2 ALTER TABLE mysite_users ADD website varchar(255) DEFAULT '' AFTER phone;


Now go to administrator\components\com_users\views\user\tmpl
open file form.php and put the following lines after line 132 … just add as new row in table

        
Seems joomla doesn’t allow output overirde for admin component ! If that was possible then we didn’t need to change core file but put this view file in template folder. I will show you how to do that in front end uesr component. But before that Let me show you how it will look after the above changes done properly.
Now we need to do some changes for front end. Please go to components\com_user\views\register\tmpl
and now open file default.php for edit
After line 73 , after the password verify row … add these lines
Let me show you how this will l;ook in registration page if every thing is done properly.
I told you , we can do the same changes in view for front end component without changing core files. Copy that default.php file from components\com_user\views\register\tmpl and now go to your current template folder. Let’s it’s default rukhmilkway … Check there is a folder name html in it. if your custom template doesn’t have any html folder then create one. now go to the html folder and create a folder named “com_user” (if there is no folder with this name as some custom template use output override and use same method for styling) and create a folder in com_user folder as named “register” and paste the default.php file in it. Actually you need to copy all the php files from components\com_user\views\register\tmpl to templates\{your custom template name here}\html\com_user\register
Isn’t this fun ?
Oh we have left one thing still. If we want to give user to edit their profile from front end ? We need to edit one view file again. But this this time we will not change core file in view but at first copy the view from file front end component to template folder … follow the way I shown just now.
So according to default template go to templates\rhuk_milkyway\html\com_user\user (create folder “user” in com_user same way) and copy all the php files(two files default.php and form.php) from components\com_user\views\user\tmpl …. I think it’s now easy …
Open file form.php and edit/put new lines after 70(it’s just a end of a if-end condition)




Let me show another screenshot how the edit details from front end looks
that’s all. Let me know if you have any problem.

Tuesday, August 24, 2010

Hostage taking in Manila + 8 Hong Kong tourists dead

 MANILA, Aug. 23 (Xinhua) -- The eleven-hour long hostage-taking incident in the Philippine capital ended Monday night with eight Hong Kong tourists dead.


Fifteen Hong Kong tourists, three of whom are children, survived the ordeal. Eight were injured - two of whom are critical condition and they are being treated in local hospitals. The rest were billeted in a hotel where they underwent a "stress debriefing" by Tourism Secretary Alberto Lim and Social Welfare Secretary Corazon Soliman.


The hostage-taker, former Police Senior Inspector Rolando Mendoza, was killed after local police assaulted the bus to save the hostages.


The Hong Kong government is dispatching a chartered plane to transport family members of the tourists involved in the abduction.

Medics, community volunteers and psychologists were also onboard to help the victims.



Shortly after the incident ended around 9 p.m. local time, the Security Bureau of the Hong Kong government has issued a "Black Outbound Travel Alert" for the Philippines, urging Hong Kong residents to avoid all travel to the country.


The black alert is the highest level of Hong Kong's three-sign Outbound Travel Alert system, indicating a "severe threat" exists and all travel to the destination should be avoided.


The Hong Kong government said it has asked the Travel Industry Council to forward messages to Hong Kong's tour groups still in the Philippines, requiring them to come back to Hong Kong as soon as possible.

Mendoza, brandishing an M-16 rifle, hijacked a tourist bus Monday morning, around 10 a.m. There were 25 people onboard, 22 were Hong Kong tourists, three others were Filipinos: a bus driver, a translator and a photographer. The abduction was held near Rizal Park, a major tourist site in Manila.


Mendoza was dismissed from service for extortion and forcing a chef to swallow "shabu." He hostaged the bus, demanding local officials to reinstate him.


Local police went to the scene and cordoned the area. Two police officers, Superintendent Orlando Yebra Jr. and Chief Inspector Romeo Salvador negotiated with Mendoza. After hours of talks, Mendoza freed seven tourists, the Filipino translator and the photographer.


Senior Police Officer 2 Gregorio Mendoza, the brother of hostage-taking cop, joined the negotiations, urging him to surrender peacefully.

Gregorio walked away from the negotiations within five minutes, telling his brother "Walang mangyayari dito (Nothing will happen here)."

The bus driver managed to escape from captivity around 7:30 pm, local time. He claimed that Mendoza killed the remaining 15 hostages. This spurred the police to assault the bus, killing Mendoza.


Hong Kong Chief Executive Donald Tsang said Monday night he was very sad and disappointed over the tragedy and the losses of lives of Hong Kong residents and felt very angry over the deeds of the thug. He extended condolences to the families of those killed and injured in the incident.

Tsang said his government would provide everything needed to assist those families to overcome current difficulties.


Tsang said Hong Kong would lower the flag of the Hong Kong Special Administrative Region at half-mast to mourn the death of the seven tourists, adding that his government would ask the Philippine government to explain the incident.

Tuesday, August 3, 2010

Link EON Union Bank Debit Card to Paypal Account

Instruction on How To Link And Confirm Your EON Union Bank Debit Card To Your Paypal Account

How to Open a PayPal Account?
  1. Sign-up for an account at www.paypal.com. Enter your profile. Be sure to select Philippines as the country where you live in and use U.S. DOLLARS as the primary currency. (*** Did i tell you that i already have an existing Paypal account? Yep, i have an account already at paypal before i intended to bind it with my Debit EON Visa Card. This can be done.)
  2. For the verification process, enter your 16- character card number and Card Verification Value(CVV) –last 3-digit number found at the back of the card – mine was debit card. When you are done, click on submit. Your debit card will be charged USD 1.95 or PHP 89.7 ( *** PHP 46.00 as of this writing). Dont worry this would be refunded once your debit card was successfully linked to paypal. Debit card should be with active status – double check your status on your cyber eon account. Check for history details of this transaction via your cyber account at www.unionbankph.com
  3. Enter your address of record at UnionBank as your billing address that appears in your monthly statement, and for EON Visa Electron ,or use the address found in the Profile page at the Unionbankph.com online banking site. The address should be the same for both Union Bank and Paypal otherwise you will get a denied service.
  4. You need to link and confirm your debit card to paypal. Paypal will ask you for an EXP number. This can be seen immediately via cyber account online history details (www.unionbankph.com) just right after you clicked on submit on Paypal. Look for transaction details something like : VISA-0288PAYPAL-*EXPUSE SG (840) .. Take note of the 4-digit number – in this case 0288. (** I intentionally changed the 4-digit in my example =) This is what they refer as Paypal Code to be used a confirmation reference to your debit card. Enter this code to paypal – confirm my card page.
How to open Union Bank EON Debit Card

  1. Get Unionbank’s EON Card Cyber Account. Go to the nearest UNION BANK in your location and fill up a form for EON Cyber Space Account.
  2. After five working days, you have to call the branch where you applied in. It’s very important to call them because this is the only way you can verify if the online registration has reached their end for processing. Call them and ask them if your EON card is ready to pick up.

  3. When you are ready to pick up your EON card, go to the branch… go to their New Accounts section or ask the security guard where you could claim your EON card. Better call your branch first for confirmation i suggest. Present your two valid IDs (with picture in the card) and pay Php350.00 for the card’s annual fee. Also, it’s very important again to deposit at least Php100.00 in your EON card, especially if you are going to apply for PayPal. Wait for three days for your EON visa card to be activated.

  4. If your EON visa card is activated already, go to Unionbank website and enroll for a eon cyber account. Be ready with your card and account number and pin. Also, think of your user ID, this user ID will be your new username next time you log in to access your accounts online. Wait for three to five days to be activated. Upon activation, you should see some history details and you should know also the status of your debit visa card.

NOW YOU CAN START EARNING AND MAKING MONEY ONLINE THROUGH BLOGS AND TRANSFER FUNDS FROM PAID TO CLICK SITES AND OTHER ONLINE EARNING TO YOUR PAYPAL ACCOUNT.

Donate

Kindle Wireless Reading Device, Free 3G + Wi-Fi, 6" Display, Graphite, 3G Works Globally - Latest GenerationRecoveryIron Man 2 (Blu-ray/DVD Combo + Digital Copy)Kindle Wireless Reading Device, Free 3G, 6" Display, White - 2nd GenerationP90X Extreme Home Fitness Workout Program - 13 DVDs, Nutrition Guide, Exercise PlannerKindle Lighted Leather Cover, Black (Fits 6" Display, Latest Generation Kindle)Clash of the Titans [Blu-ray]