11
skenow
Re: I want to make WFChannel links display outside of the module
  • 2007/6/1 15:46

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Quote:

trspice wrote:
Nachenko thanks for the assistance. Your efforts have been quite rewarding.

However, the code positions the link in the main menu but that is not what I want to do. the WFChannel module automatically produces a link to each page it creates and places the link on each page within the module.

I want to display these links outside the module so it shows throughout the site on all pages. The code that the module uses to show the links within its pages is that which I posted first. It is from templates/wfchannel_index.html. On its own outside the module it won't display the links so I know it needs some corresponding command from within the module.

I see the following in the module's index.php
if (is_object($xoopsUser))
            {
                
$chanlink['id'] = "?op=link";
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($titlelink),1);
                
$xoopsTpl->append('chanlink'$chanlink);
            }
            elseif (
$xoopsModuleConfig['anonlink'])
            {
                
$chanlink['id'] = "?op=link";
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($titlelink),1);
                
$xoopsTpl->append('chanlink'$chanlink);
            }
        }


I figure this bit of code (it seems related with $chanlink) must be making it display in the module but I don't know how to configure it to work.

I tried to do this but got errors
<{php}>
if (
is_object($xoopsUser))
{
$chanlink['id'] = "?op=link";
$chanlink['pagetitle'] = $myts->displayTarea(trim($titlelink),1);
$xoopsTpl->append('chanlink'$chanlink);
}
elseif (
$xoopsModuleConfig['anonlink'])
{
$chanlink['id'] = "?op=link";
$chanlink['pagetitle'] = $myts->displayTarea(trim($titlelink),1);
$xoopsTpl->append('chanlink'$chanlink);
}
}
<{/
php}>

<{foreach 
item=chanlink from=$chanlink}>
<
a href="index.php<{$chanlink.id}>"><{$chanlink.pagetitle}>a>
<{/foreach}>


If this is conquered it will be very useful for many users.

Thanks


The problem here is you do not have the query to gather the link information for this code to display. There should be a query farther up in the page that returns the list of pages and their associated titlelink

12
trspice
Re: I want to make WFChannel links display outside of the module
  • 2007/6/4 14:59

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


This is what the full function is. I see the query but don't know how to implement into my theme.html. Could you please instruct. Thanks

function display_menus()
{
    global 
$xoopsDB$myts$xoopsModule$xoopsModuleConfig$xoopsUser$xoopsTpl$groups$gperm_handler;


    
/**
         * get menu items if current page is default
         */
    
if ($xoopsModuleConfig['displaymenu'] == 1)
    {
        
$result2 $xoopsDB->query("SELECT CID, pagetitle, pageheadline FROM " $xoopsDB->prefix("xtrapages_01") . " WHERE (publishdate > 0 AND publishdate <= " time() . ") AND (expiredate = 0 OR expiredate > " time() . ") AND defaultpage = '0' AND mainpage = '1' ORDER BY weight");
        
$total['total'] = $xoopsDB->getRowsNum($result2);

        while (
$query_data $xoopsDB->fetcharray($result2))
        {
            if (
$gperm_handler->checkRight('Page Permissions' $query_data['CID'], $groups$xoopsModule->getVar('mid')))
            {
                
$chanlink['id'] = "?pagenum=".$query_data['CID'];
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($query_data['pagetitle']));
                if (empty(
$query_data['pagetitle']))
                {
                    
$chanlink['pagetitle'] = $myts->displayTarea(trim($query_data['pageheadline']), 1);
                }
                
$xoopsTpl->append('chanlink'$chanlink);
            }
        }
        
$result3 $xoopsDB->query("SELECT mainpage, titlelink FROM " $xoopsDB->prefix("xtrapages_01linktous") . "");
        list(
$linktous$titlelink) = $xoopsDB->fetchrow($result3);

        if (
intval($linktous) == 1)
        {
            if (
is_object($xoopsUser))
            {
                
$chanlink['id'] = "?op=link";
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($titlelink),1);
                
$xoopsTpl->append('chanlink'$chanlink);
            }
            elseif (
$xoopsModuleConfig['anonlink'])
            {
                
$chanlink['id'] = "?op=link";
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($titlelink),1);
                
$xoopsTpl->append('chanlink'$chanlink);
            }
        }

        
$result4 $xoopsDB->query("SELECT mainpage, titlerefer FROM " $xoopsDB->prefix("xtrapages_01refer") . "");
        list(
$referafriend$refertitle) = $xoopsDB->fetchrow($result4);

        if (
intval($referafriend) == 1)
        {
            if (
is_object($xoopsUser))
            {
                
$chanlink['id'] = "?op=refer";
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($refertitle),1);
                
$xoopsTpl->append('chanlink'$chanlink);
            }
            elseif (
$xoopsModuleConfig['anonrefer'])
            {
                
$chanlink['id'] = "?op=refer";
                
$chanlink['pagetitle'] = $myts->displayTarea(trim($refertitle),1);
                
$xoopsTpl->append('chanlink'$chanlink);
            }
        }
    }
}
There's nothing but science....
The Reggae Album

Login

Who's Online

428 user(s) are online (328 user(s) are browsing Support Forums)


Members: 0


Guests: 428


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits