Username in external link on Joomla 1.5 - joomla

http://webchat.quakenet.org/?nick=**insertnickhere**&channels=test&uio=d4
Hi i want to use this external link on my Joomla menu. But instead of insertnickhere i want to use the actual username of the logged in user. So when the link gets clicked by a user it assigns the username.
I tried to insert {$user->username}
But it only carried over {$user->username}, so it didnt work.
Edit: I inserted this link as external link to my Joomla menu, so that every user can join this irc webchat with his username.
This is a premade link from the quakenet irc webchat, where i changed the static nickname variable to {$user->username}, so that the username of the logged user is carried over to this link.
Any Idea or suggestion how I get this?

First get the user object:
<?php $user = & JFactory::getUser(); ?>
Then echo the username in the url:
link

Related

redirect back not saving auth()->user

I have a form to update user information including username. on the same page, there is a sidebar that has a profile button href="{{route('profile',auth()->user())}}"
once the form is saved I redirect to the same page, the route to update user info is
Route::post('/profile/{user:name}/update' , 'ProfileController#update')->name('update-profile');
so it contains the name ( not the id).
the issue is when the page is redirected back to the same page the profile button is still containing the old user name, which leads to 404. Is there any solution to redirect back and updating the auth user in the sidebar with a new username?
Thank you
That's strange it should normally work. You can do
\Auth::setUser($newUser);
to set a new one.

How can registered user can create a new article from joomla front-end in 2.5?

How to create a new article from joomla front-end by registered user. I tried a lot but i cant solves the problem.
Only super user can create a new article.
I create a new menu called create article in main menu and its access is gives to registered. But i still got the error
An error has occurred.
The requested page cannot be found.
Home Page
If difficulties persist, please contact the System Administrator of this site and report the error below.
403 You are not authorised to view this resource.
when i will try to create a new article by registered user from front-end.
Please help me for this.
Thanx in advance...
By default registered users do not have create rights, you need to be an author for that.
You can do what you want in two ways, change the permission for Registered in com_content for Create to Allowed or you could change the default user group for new users to Author. YOu set the default group in the user manager options.
The working of user role in joomla is something like this:
$user =& JFactory::getUser();
//print_r($user);
//echo $user->get('gid');
if($user->get('gid') == 25 ){
//allow user
} else{
//disallow or redirect to somewhere
}
The above code allows for user group 25 only.
What you need to do is:
Find the code for registered user and include the user group code in if condition.
Note: You can find the user group code from jos_users table.

Joomla registration error

In the website http://www.ple-intl.com/NewUpgrade, I am using joomla 2.5 & getting an below error during registration
It registered the user but, does not send the activation link, however it is set as a self in user options.
when user click on register after filling form it shows an 404 error. (personally i dont change any thing core, & i dont want to but i am getting an error i checked all the things)
Some Plugin Information
I installed virtue mart in it, but every thing is defualt
I am user Super Login Module for login registration which calls the default joomla signup page.
Kindly guide what i am missing..I am tired to sort that out but none of my idea works.
Thanks it start working now, below i have mentioned the reason why it showing error.
The email i was inserted is actually registered before & when i remove that id i did'not remove the product related to it in virtue mart.
second virtue mart registration activation link which send in email has some problems, on the below link solution is discussed.
http://forum.virtuemart.net/index.php?topic=99755.0

Protect joomla article with password

I have a joomla 1.5.21 website for a friend, he created a selling page for a program...and he wants to protect the page of the program , and send the password to everyone who purchases it.
So I've downloaded the contentPassword Plugin, and put the code : {password pass="123"} in the page I want protect.
When entering the page..the page asks me to enter password, but when I insert password, (123) it doesn't open the page.
My question is : is there someone whose familiar with this plugin? or is there any other better method that will save me more time?
thank you in advance
You could try Mighty Membership. It limits access to articles, modules, components etc. Users can pay for a subscription which will allow them access to a specific article. You can also limit the amount of times they can view the page, so once they've paid, they can view the page once to download the software then it will be restricted again.
I've just used this to make a basic subscription only video site and it's pretty good.
Sadly it's not free though.
I really don't like to install plugins if it's not necessary. In your case I would add to the beginning of the article the following php code:
<?php
$protect = $_GET['prot'];
if ($protect != 'xR5dL0Nj76H'){
//get out of here if you don't send the correct GET parameter...
header('Location: http://www.google.com/');
}
//echo "logged in successfully!";
?>
and of course you'll have to send the users to the article with the GET parameter: &prot=xR5dL0Nj76H (its equivalent to have a shared password to all the users - like you describe)

Getting Magento user session values in joomla

In my site i have joomla 1.6 and magento 1.5, i would like to get the magento logged user session values in joomla to show as logged in .....
i have tried the following code :
'frontend'));
$session = Mage::getSingleton('customer/session', array('name'=>'frontend'));
print_r($session);
echo Mage::getSingleton('customer/session')->getCustomer()->getEmail();
echo Mage::helper('customer')->getCustomerName();
?>
But im getting empty values
Note : Sometimes i may get the customer details , if i tried to test the answer like delete the browser cookies and delete cache in magento ,again log in , it results as empty array
It's not that simple. Being logged in implies that there is an associated user account that you are logging in to. You will have all kinds of problems is you have a user register for an account in one system but not the other. What you need is a bridge that syncs the user account across both systems and provides a unified login.
http://extensions.joomla.org/extensions/e-commerce/e-commerce-bridges/9440

Resources