Recent Topics

Requesting New Core Widget

started by on Feb 13, 2017 – Last touched: May 27, 2017

Feb 13, 2017 17:32    

Please can you include a contact widget in the core widgets. So that if one would like to add a quick contact widget in the footer container it can be done easily.
it can be exactly what one would find in _msgform.disp.php but capable of being added to containers.

Is this possible to do as a widget?

Feb 14, 2017 00:11

I actually made a plugin instead, however please can the dev provide the ability to specify a custom template path for the _contact_msg.form.php in anon_async.php something like:

case 'get_msg_form':
		// display send message form
		$recipient_id = param( 'recipient_id', 'integer', 0 );
		$recipient_name = param( 'recipient_name', 'string', '' );
		$subject = param( 'subject', 'string', '' );
		$email_author = param( 'email_author', 'string', '' );
		$email_author_address = param( 'email_author_address', 'string', '' );
		$redirect_to = param( 'redirect_to', 'url', '' );
		$post_id = NULL;
		$comment_id = param( 'comment_id', 'integer', 0 );
		$BlogCache = & get_BlogCache();
		$Collection = $Blog = $BlogCache->get_by_ID( $blog_ID );
		$template_path = param( 'template_path', 'string', '' );

		locale_activate( $Blog->get('locale') );

		if( $recipient_id > 0 )
		{ // Get identity link for existed users
			$RecipientCache = & get_UserCache();
			$Recipient = $RecipientCache->get_by_ID( $recipient_id );
			$recipient_link = $Recipient->get_identity_link( array( 'link_text' => 'nickname' ) );
		}
		else if( $comment_id > 0 )
		{ // Anonymous Users
			$gender_class = '';
			if( check_setting( 'gender_colored' ) )
			{ // Set a gender class if the setting is ON
				$gender_class = ' nogender';
			}
			$recipient_link = '<span class="user anonymous'.$gender_class.'" rel="bubbletip_comment_'.$comment_id.'">'.$recipient_name.'</span>';
		}

		$blog_skin_ID = $Blog->get_skin_ID();
		if( ! empty( $blog_skin_ID ) )
		{ // check if Blog skin has specific concact message form
			$SkinCache = & get_SkinCache();
			$Skin = & $SkinCache->get_by_ID( $blog_skin_ID );
			$ads_current_skin_path = $skins_path.$Skin->folder.'/';
		}

	if( ! empty( $template_path) && file_exists( $template_path) )
	{ // Template file exists for the current form
		require $template_path;
	}
	else {
	
	require skin_template_path( '_contact_msg.form.php' );
	
	}
	
		break;

Feb 16, 2017 18:22

We have this widget in the works already in some branch. I will pop up in a future release.

May 24, 2017 09:06

@achillis wrote earlier:

I actually made a plugin instead, however please can the dev provide the ability to specify a custom template path for the _contact_msg.form.php in anon_async.php something like:

case 'get_msg_form':

    // display send message form
    $recipient_id = param( 'recipient_id', 'integer', 0 );
    $recipient_name = param( 'recipient_name', 'string', '' );
    $subject = param( 'subject', 'string', '' );
    $email_author = param( 'email_author', 'string', '' );
    $email_author_address = param( 'email_author_address', 'string', '' );
    $redirect_to = param( 'redirect_to', 'url', '' );
    $post_id = NULL;
    $comment_id = param( 'comment_id', 'integer', 0 );
    $BlogCache = &amp; get_BlogCache();
    $Collection = $Blog = $BlogCache-&gt;get_by_ID( $blog_ID );
    $template_path = param( 'template_path', 'string', '' );

    locale_activate( $Blog-&gt;get('locale') );

    if( $recipient_id &gt; 0 )
    { // Get identity link for existed users
        $RecipientCache = &amp; get_UserCache();
        $Recipient = $RecipientCache-&gt;get_by_ID( $recipient_id );
        $recipient_link = $Recipient-&gt;get_identity_link( array( 'link_text' =&gt; 'nickname' ) );
    }
    else if( $comment_id &gt; 0 )
    { // Anonymous Users
        $gender_class = '';
        if( check_setting( 'gender_colored' ) )
        { // Set a gender class if the setting is ON
            $gender_class = ' nogender';
        }
        $recipient_link = '&lt;span class=&quot;user anonymous'.$gender_class.'&quot; rel=&quot;bubbletip_comment_'.$comment_id.'&quot;&gt;'.$recipient_name.'&lt;/span&gt;';
    }

    $blog_skin_ID = $Blog-&gt;get_skin_ID();
    if( ! empty( $blog_skin_ID ) )
    { // check if Blog skin has specific concact message form
        $SkinCache = &amp; get_SkinCache();
        $Skin = &amp; $SkinCache-&gt;get_by_ID( $blog_skin_ID );
        $ads_current_skin_path = $skins_path.$Skin-&gt;folder.'/';
    }

if( ! empty( $template_path) &amp;&amp; file_exists( $template_path) )
{ // Template file exists for the current form
    require $template_path;
}
else {

require skin_template_path( '_contact_msg.form.php' );

}

    break;

@fplanque please can you look at this and give the ability to specify a custom template path in anon_async.php

May 24, 2017 09:08

//anon_async.php
case 'get_msg_form'

$template_path = param( 'template_path', 'string', '' );

if( ! empty( $template_path) && file_exists( $template_path) )
{ // Template file exists for the current form
    require $template_path;
}
else {

require skin_template_path( '_contact_msg.form.php' );

}

May 27, 2017 09:40

@achillis just a question, why do you need the template path to be configurable? I can figure it out, but can you please give us an example of how are you using this (or how are you planning to use it)? Thank you.

This post has 1 feedback awaiting moderation...


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.