• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: submit buttons on multiple pages after login

submit buttons on multiple pages after login 13 years 16 hours ago #13409

  • wdemilly
  • wdemilly's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
On my site, I have users submit an RSForm before having access to a number of articles.

Each article describes a different investment.

I would like to have a button at the head of each article. If the user clicks the button, I'd like to have an email sent to the admin. The email would be written much like the admin emails in RSForm. That is, it would contain the user's name, email, and the particular investment.

A month or so ago a programmer solved a similar problem by hard-coding this into the controller.php file within the banners component. (A user clicks on a banner, and this causes an email to be sent to admin). I'm posting it in the event it might help:

(The purpose of a simple submit button rather than another form is to avoid having to ask the visitor to re-enter their information).


<?php
/**
 * @version		$Id: controller.php 14401 2010-01-26 14:10:00Z louis $
 * @package  	Joomla
 * @subpackage	Banners
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant to the
 * GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open
 * source software licenses. See COPYRIGHT.php for copyright notices and
 * details.
 */
 
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );
 
jimport( 'joomla.application.component.controller' );
 
/**
 * Banners Controller
 *
 * @package  	Joomla
 * @subpackage	Banners
 * @since		1.5
 */
class BannersController extends JController
{
	function click()
	{
		$bid = JRequest::getInt( 'bid', 0 );
		if ($bid)
		{
			$model = &$this->getModel( 'Banner' );
			$model->click( $bid );
			$this->setRedirect( $model->getUrl( $bid ) );
		}
	}
 
    // ivan: control of custom banners
    function do_custom_click()
    {
        global $mainframe;
 
        $target_link = JRequest::getVar('target_link',null);    
 
        if($target_link)
        {
            // send email
            $user =& JFactory::getUser();
            if($user->id)
            {
                $mailfrom="noreply@ascentfx.com";
                $fromname="Ascentfx";
                $mailTo="admin@mywebsite.com"; "admin@anothersite.com";
                $msgSubAdmin="US Referral";
                $now = JFactory::getDate();
                $date_on = JHTML::_('date', $now->toMySQL(), '%A, %d %B %Y %H:%M');  
                $msgAdmin="Hi,\n\nUser has clicked on Ascent.Aurapoint banner.\nDate: {$date_on}\nName: {$user->name}\nEmail: {$user->email}\n\nRegards,\nAscentfx";
 
                JUtility::sendMail($mailfrom, $fromname, $mailTo, $msgSubAdmin, $msgAdmin);
            }
 
            $mainframe->redirect($target_link);
        }
        else
            $mainframe->redirect("index.php");
 
    } 
}


The code for the banner was simply:
<form style="text-align: center;" method="post" action="index.php" mce_style="TEXT-ALIGN: center"><input name="target_link"
 value="http://www.a-website.com/" type="hidden">
 <input name="task" value="do_custom_click" type="hidden"> <input name="option"
 value="com_banners" type="hidden"> <input border="0" name="submit" alt="Ads"
 src="http://www.mywebsite.com/images/stories/banner.png"
 type="image" mce_src="images/stories/banner.png"></form>


If anyone can help, I'll appreciate it greatly! (PS I do have some modules such as "jumi" which will allow me to put php code within an article).
Last Edit: 13 years 16 hours ago by wdemilly.
The administrator has disabled public write access.

Re:submit buttons on multiple pages after login 12 years 11 months ago #13427

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

You can simply use a standard RSform!Pro placed on the top of each article.

If you wish to have have pre-filled data, you can use the Default value area to extract the required data. As an example, to get the logged in user email you could use something like this:
//<code>
$user = JFactory::getUser();
return $user->email;
//</code>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 12 years 11 months ago by alexp.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!