Recent Topics

1 Feb 14, 2018 14:48    

Version 6.9.6 on http://cxghana.com/index.php/help?blog=1&disp=help
Hi
After copying [skins_flallback_v5/_help.dip.php] to my skin, I've edited it to add a contact to the site manager as well as content manager. I'm wondering how can I change 'href="'.$Blog->get_contact_url().'"' ) to bring up details for another user member of the 'organisation'

Thanks

2 Feb 14, 2018 15:09

for user profile like this: disp=user&user_ID=6989
or
for user contact page like this: disp=msgform&recipient_id=6989

You will need to know the user ID in the above the id is 6989

you could have a field in your skin class ...skins/YOURSKIN_FOLDER/_skin.class.php

like so:

//in skins/YOURSKIN/_skin.class.php


function get_param_definitions( $params )
{
	return array(
		
			'content_manager_id' => array(
						'label'		=> T_('Content Manager ID'),
						'type'		=> 'integer',
						'size' 		=> 10,
						'note'			=> T_('Enter your user ID'),
						)
		
	);
	
}

//copy _help.dip.php to your skin folder then in _help.dip.php


global $Blog, $Skin;

$user_ID = $Skin->get_setting( 'content_manager_id' );

$UserCache = & get_UserCache();

// Check if the specified user ID exist
if( ! $User = $UserCache->get_by_ID( $user_ID, false ) )
{
	// Specified user id does not exist, use owner user ID
	$user_ID = $Blog->owner_user_ID;
}

// build the link

$msg_form = url_add_param( $Blog->gen_blogurl(), '?blog='.$Blog->ID, '&' ); // you can specify a specific blog here?

$msg_form = url_add_param( $msg_form, 'disp=msgform','&'); // add the call for disp of the msgform

$msg_form = url_add_param( $msg_form, '? recipient_id ='.$Skin->get_setting( 'content_manager_id' ), '&' );// add the recipient ID

$content_manager_link = action_icon( T_('Contact'), 'email', url_add_param( $msg_form,'subject=Content Issue'), T_('Email') );

//echo $content_manager_link;

echo '<a href="'.$msg_form.'" title="" target="_blank">'.T('Content Manager').'</a>';

3 Feb 14, 2018 15:41

Thanks very much. Will check out your ideas.
EDIT I'm using the second option to start with

disp=msgform&recipient_id=6989

Thanks again

4 Feb 14, 2018 16:02

I edited my answer. Check it out. Sorry I answered out of hand but just reviewed/checked it properly now.

5 Feb 14, 2018 16:11

@amoun wrote earlier:

Thanks very much. Will check out your ideas.
EDIT I'm using the second option to start with disp=msgform&amp;recipient_id=6989


Thanks again

You should consider incorporating it into your skin class to make reduce hardcoding of data that might change, such as a user id which you can define is Skin Settings instead of having to change it in _help.dip.php everytime you need to chnage the user.

Note: My example above is NOT tested, just gave you a snippet from my thoughts.

6 Feb 14, 2018 16:12

Trying the skin class option as we speak :)

7 Feb 20, 2018 13:03

Did this work for you?

8 Feb 20, 2018 14:01

No it didn't work straight of the box so to speak, and I was getting somewhere with my hard coding option, as usual and did this to my [/skin/***/_mgs_contact.form.php}

 $title="Website Technician";
	if($recipient_id ==3)
	{$title="Production Manager";}
	$Form->hidden( 'recipient_id', $recipient_id );
	$Form->hidden( 'post_id', $post_id );
	$Form->hidden( 'comment_id', $comment_id );
	$Form->hidden( 'redirect_to', url_rel_to_same_host($redirect_to, '/htsrv') );
	$Form->info( T_('To'), $recipient_link . ' :: ' .$title);

Thanks and may look at your recommendation again when I have more head space, but this works and is simple enough to update new versions :)


Form is loading...