LOL! i should have seen that one coming: i've updated it, still available here (http://obstacle.com/_bin/input.generic.txt). Two new variables: "multiple" and "multiple_size". Pretty self explanatory: when the former is set to true, you will have the possibility of using multiple selections. "multiple_size" set the number of viewable rows.
Note 1: the plugin uses a different field type depending on "multiple"'s value - INT when single, VARCHAR when multiple. So it's preferable not to switch multiple/single on the fly; erase the field and/or create a new one.
Note 2: with "multiple", the values stored are semi-colon separated ( 23;4;34;5;6; - which explains the VARCHAR). You may need to code a quick plugin to use the data. I'll refer you to the plugin in this very thread, an easy enough tweak to have it return a usable array.
g'luck! jeff :)
I'm not quite sure how to proceed on displaying
the selected publications here. I have the input
plugin working nicely, but now I need to display
it. I think that maybe with Jorn's conversion to
pnForum from XForum that some code has been lost
in this forum, or there's just too many different
snippets here for me to see what I need. Can
someone help out? Maybe a link to "display
multiple select pub" plugin?
<a href="index.php?module=pagesetter&func=viewpub&tid=your_tid_here&pid=<!--[$generic]-->">LINK</a><!--[your_plugin pids=$generic]--><!--[pnmodapifunc modname=MODULE_NAME func=FUNC_NAME pids=$generic]-->function smarty_function_pagesetter_pubinfo($params, &$smarty)
{
extract($params);
unset( $params );
if( !$tid )
{
$smarty->trigger_error( "pagesetter_pubinfo: missing parameter 'tid'" );
return false;
}
if( !$pid )
{
$smarty->trigger_error( "pagesetter_pubinfo: missing parameter 'pid'" );
return false;
}
$pubinfo = pnModAPIFunc ( 'pagesetter', 'user', 'getPub',
array( 'tid' => $tid,
'pid' => $pid ) );
$smarty->assign($assign, $pubinfo);<!--[pagesetter_pubinfo pid=1 tid=5 assign="pubarray"]-->
<!--[foreach from=$pubarray item=curr_id]-->
id: <!--[$curr_id]--><br />
<!--[/foreach]--><!--[pagesetter_pubinfo pid=1 tid=5 pids=$generic assign="pubarray"]-->1.
function smarty_function_pagesetter_pubinfo($params, &$smarty){
extract($params);
unset( $params );
// 1. turn string into Array
if(!$pids){
//i trigger error here but it could react differently
$smarty->trigger_error( "pagesetter_pubinfo: missing parameter 'pids'" );
return false;
}else{
$pids = explode(";", $pids);
}
if( !$tid )
{
$smarty->trigger_error( "pagesetter_pubinfo: missing parameter 'tid'" );
return false;
}
if( !$pid )
{
$smarty->trigger_error( "pagesetter_pubinfo: missing parameter 'pid'" );
return false;
}
//2. loop through the array
foreach($pids as $i){
$pubinfo[] = pnModAPIFunc ( 'pagesetter', 'user', 'getPub',
array( 'tid' => $tid,
'pid' => $i) );
}
$smarty->assign($assign, $pubinfo);<!--[foreach from=$pubarray item=i]-->
id: <!--[$i.core.pid]-->; other_var: <!--[$i.other_var]-->;<br />
<!--[/foreach]--><!--[$pubarray.lastname]--><!--[$pubarray.core.author]-->, <!--[$pubarray.author]-->, <!--[$pubarray.core.pid]-->,
<!--[$pubarray.pid]--><!--[pnusergetvar name="uid" assign=uid]-->
<!--[if uid = $users]-->
blah blah
<!--[else]-->
blab blab
<!--[/if]-->Template courtesy of Designs By Darren.