vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 07-29-2004, 10:37 AM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Question Mod request

When you subscribe to a forum, you see the forum name and last post in the UserCP.

I'd like to be able have a block in the homepage, that shows your subscribed forums. (Just the name of the forum) That the user can click on to go straight to that forum.

Obviously it would be dynamic and change as you subscribe and unsuscribe.

Is that possible?
__________________



  #2  
Old 07-30-2004, 06:43 PM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

Anybody?

This is the code for the Subscribed Forums section of the UserCP

Hopefully it will help someone get started with this

Quote:
<!-- ############## SUBSCRIBED FORUMS ############## -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="54%" align="right"><tr><td>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>">Subscribed Forums
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('usercp_forums')"><img id="collapseimg_usercp_forums" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_usercp_forums].gif" alt="" border="0" /></a>
$vbphrase[subscribed_forums]
</td>
</tr>
</thead>
<tbody id="collapseobj_usercp_forums" style="$vbcollapse[collapseobj_usercp_forums]">
<tr align="center" valign="bottom">
<td class="thead" width="2%"> </td>
<td class="thead" align="$stylevar[left]" width="80%">$vbphrase[forum]</td>
<td class="thead">$vbphrase[last_post]</td>
<td class="thead">$vbphrase[replies]</td>
<td class="thead">$vbphrase[views]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="thead" width="20%">$vbphrase[moderator]</td>
</if>
</tr>
$forumbits
</tbody>
</table>
<br />
</table>
<!-- ############## END SUBSCRIBED FORUMS ############## -->
Any help with this would be greatly appriciated
__________________




Last edited by tomshawk; 07-30-2004 at 07:35 PM.
  #3  
Old 08-01-2004, 08:03 PM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

Well, Just for giggles, I posted the above into a template and made a module and a page. For testing purposes, I made it a center block, but I want it to be a side block in the end.

http://www.tomshawk.com/index.php?page=subscribed

As you can see, it doesnt work

I know from the forums usercp.php file that this is needed somewhere

PHP Code:
// ############################### start subscribed forums ###############################
// get only subscribed forums
cache_ordered_forums(10$bbuserinfo['userid']);
$show['forums'] = false;
foreach (
$forumcache AS $forumid => $forum)
{
 if (
$forum['subscribeforumid'] != '')
 {
  
$show['forums'] = true;
 }
}
if (
$show['forums'])
{
 if (
$vboptions['showmoderatorcolumn'])
 {
  
cache_moderators();
 }
 else
 {
  
$imodcache = array();
  
$mod = array();
 }
 
fetch_last_post_array();
 
$forumbits construct_forum_bit(-101);
 if (
$forumshown == 1)
 {
  
$show['forums'] = true;
 }
 else
 {
  
$show['forums'] = false;
 }

I wonder if putting this into the cmdp_index.php file would work.

Actually only parts of it, the parts to create only the forum name
__________________



  #4  
Old 08-03-2004, 12:39 AM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Exclamation Re: Mod request

OK, As you can see, I have it working now, meaning I have it showing exactely the same thing that would show in UserCP Subscribed Forums

http://www.tomshawk.com/index.php?page=subscribed

Nothing if your not logged in, and forums if you are logged in, but it shows everything, forums, threadbits, Everything.

Could I please get some help narrowing it down to just what I need, Only the forum name

Here is the code for the Template I have

PHP Code:
<!-- ############## SUBSCRIBED FORUMS ##############  -->
<table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
thead>
 <
tr>
  <
td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>">
   <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('usercp_forums')"><img id="collapseimg_usercp_forums" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_usercp_forums].gif" alt="" border="0" /></a>
   
$vbphrase[subscribed_forums]
  </
td>
 </
tr>
</
thead>
<
tbody id="collapseobj_usercp_forums" style="$vbcollapse[collapseobj_usercp_forums]">
 <
tr align="center" valign="bottom">
  <
td class="thead" width="2%">&nbsp;</td>
  <
td class="thead" align="$stylevar[left]width="80%">$vbphrase[forum]</td>
<
td class="thead">$vbphrase[last_post]</td>
  <
td class="thead">$vbphrase[replies]</td>
  <
td class="thead">$vbphrase[views]</td>
  <if 
condition="$vboptions['showmoderatorcolumn']">
  <
td class="thead" width="20%">$vbphrase[moderator]</td>
    </if>
 </
tr>
 
$forumbits
</tbody>
</
table>
<
br />
<!-- 
############## END SUBSCRIBED FORUMS ##############  --> 
Attached is the Module subscribe.php and a picture of what it looks like now when logged in.

I have it set up as a center block on it's own page for now, but when done, I want it as a Left or Right block.


Please, Brian or someone, Please help me.

I'm willing to pay for this
__________________



  #5  
Old 08-03-2004, 02:33 AM
mholtum's Avatar
mholtum mholtum is offline
I ******* single moms.
 
Join Date: May 2004
Location: Tempe, Arizona
Posts: 1,938
Default Re: Mod request

When you get it ironed out, I am interested..
  #6  
Old 08-03-2004, 09:08 AM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

Will do

I think I know what needs to be done now.

the $forumbits code is being pulled from the includes\functions_forumlist.php

Its just going to be a matter of figuring out which section it is using then copting that, modifying it and making the new call.

boey, I dont see how you coders can do this all the time, this is frustrating stuff

Thank you mholtum, Your interest is encouraging
__________________



  #7  
Old 08-03-2004, 09:13 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Mod request

In the file you created, somewhere above the construct_forum_bit() function, try adding:
$show['hideextra'] = true;

Then in the templates (I'm assuming that uses forumhome_forumbit_levelX_) you could use this if condition to hide the other stuff:

<if condition="!$show['hideextra']">
  #8  
Old 08-03-2004, 09:35 AM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

Thanks Brian

It's probably just the placement of this

<if condition="!$show['hideextra']"> then again I'm not positive, because it did nothing

I have to get off to work, so I'll continue playing with it tonight

This is the code from the functions_forumlist.php

PHP Code:
// ###################### Start makeforumbit #######################
// this function returns the properly-ordered and formatted forum lists for forumhome,
// forumdisplay and usercp. Of course, you could use it elsewhere too..
function construct_forum_bit($parentid$depth 0$subsonly 0)
{
 global 
$vboptions$DB_site$session$bbuserinfo$stylevar$_FORUMOPTIONS$vbphrase$show;
 global 
$iforumcache$forumcache$imodcache$lastpostarray$counters$inforum;
 
// this function takes the constant MAXFORUMDEPTH as its guide for how
 // deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
 // it will assume a depth of 2.
 // call fetch_last_post_array() first to get last post info for forums
 
if (!is_array($lastpostarray))
 {
  
fetch_last_post_array();
 }
 if (!isset(
$iforumcache["$parentid"]))
 {
  return;
 }
 if (!
defined(MAXFORUMDEPTH))
 {
  
define('MAXFORUMDEPTH'1);
 }
 
$forumbits '';
 
$depth++;
 foreach (
$iforumcache["$parentid"] AS $baa)
 {
  foreach (
$baa AS $forumid)
  {
   
// grab the appropriate forum from the $forumcache
   
$forum $forumcache["$forumid"];
   if (!
$forum['displayorder'] OR !($forum['options'] & $_FORUMOPTIONS['active']))
   {
    continue;
   }
   
$forumperms $bbuserinfo['forumpermissions']["$forumid"];
   if (!(
$forumperms CANVIEW) AND $vboptions['hideprivateforums'])
   { 
// no permission to view current forum
    
continue;
   }
   if (
$subsonly)
   {
    
$childforumbits construct_forum_bit($forum['forumid'], 1$subsonly);
   }
   else if (
$depth MAXFORUMDEPTH)
   {
    
$childforumbits construct_forum_bit($forum['forumid'], $depth$subsonly);
   }
   else
   {
    
$childforumbits '';
   }
   
// do stuff if we are not doing subscriptions only, or if we ARE doing subscriptions,
   // and the forum has a subscribedforumid
   
if (!$subsonly OR ($subsonly AND !empty($forum['subscribeforumid'])))
   {
    
$GLOBALS['forumshown'] = true// say that we have shown at least one forum
    
if (($forum['options'] & $_FORUMOPTIONS['cancontainthreads']))
    { 
// get appropriate suffix for template name
     
$tempext '_post';
    }
    else
    {
     
$tempext '_nopost';
    }
    if (!
$vboptions['showforumdescription'])
    { 
// blank forum description if set to not show
     
$forum['description'] = '';
    }
    
// dates & thread title
    
$lastpostinfo $forumcache["$lastpostarray[$forumid]"];
    
// compare last post time for this forum with the last post time specified by
    // the $lastpostarray, and if it's less, use the last post info from the forum
    // specified by $lastpostarray
    
if ($forumcache["$lastpostarray[$forumid]"]['lastpost'] > 0)
    {
     
$lastpostinfo['lastpostdate'] = vbdate($vboptions['dateformat'], $lastpostinfo['lastpost'], 1);
     
$lastpostinfo['lastposttime'] = vbdate($vboptions['timeformat'], $lastpostinfo['lastpost']);
     
$lastpostinfo['trimthread'] = fetch_trimmed_title($lastpostinfo['lastthread']);
     if (
$icon fetch_iconinfo($lastpostinfo['lasticonid']))
     {
      
$show['icon'] = true;
     }
     else
     {
      
$show['icon'] = false;
     }
     
$show['lastpostinfo'] = (!$forum['password'] OR verify_forum_password($forum['forumid'], $forum['password'], false));
     eval(
'$forum[\'lastpostinfo\'] = "' fetch_template('forumhome_lastpostby') . '";');
    }
    else if (!(
$forumperms CANVIEW) AND $vboptions['hideprivateforums'] == 0)
    {
     
$forum['lastpostinfo'] = $vbphrase['private'];
    }
    else
    {
     
$forum['lastpostinfo'] = $vbphrase['never'];
    }

    
// do light bulb
    
$forum['statusicon'] = fetch_forum_lightbulb($forumid$lastpostinfo$forum);
    
// add lock to lightbulb if necessary
    
if ((!($forumperms CANPOSTNEW) OR !($forum['options'] & $_FORUMOPTIONS['allowposting'])) AND $vboptions['showlocks'] AND !$forum['link'])
    {
     
$forum['statusicon'] .= '_lock';
    }
    
// get counters from the counters cache ( prepared by fetch_last_post_array() )
    
$forum['threadcount'] = $counters["$forum[forumid]"]['threadcount'];
    
$forum['replycount'] = $counters["$forum[forumid]"]['replycount'];
    
// get moderators ( this is why we needed cache_moderators() )
    
if ($vboptions['showmoderatorcolumn'])
    {
     
$showmods = array();
     
$listexploded explode(','$forum['parentlist']);
     foreach (
$listexploded AS $parentforumid)
     {
      if (!isset(
$imodcache["$parentforumid"]))
      {
       continue;
      }
      foreach(
$imodcache["$parentforumid"] AS $moderator)
      {
       if (
$showmods["$moderator[userid]"] === true)
       {
        continue;
       }
       
$showmods["$moderator[userid]"] = true;
       if (!isset(
$forum['moderators']))
       {
        eval(
'$forum[\'moderators\'] = "' fetch_template('forumhome_moderator') . '";');
       }
       else
       {
        eval(
'$forum[\'moderators\'] .= ", ' fetch_template('forumhome_moderator') . '";');
       }
      }
     }
     if (!isset(
$forum['moderators']))
     {
      
$forum['moderators'] = '';
     }
    }
    if (
$forum['link'])
    {
     
$forum['replycount'] = '-';
     
$forum['threadcount'] = '-';
     
$forum['lastpostinfo'] = '-';
    }
    else
    {
     
$forum['replycount'] = vb_number_format($forum['replycount']);
     
$forum['threadcount'] = vb_number_format($forum['threadcount']);
    }
    if ((
$subsonly OR $depth == MAXFORUMDEPTH) AND $vboptions['subforumdepth'] > 0)
    {
     
$forum['subforums'] = construct_subforum_bit($forumid, ($forum['options'] & $_FORUMOPTIONS['cancontainthreads'] ) );
    }
    else
    {
     
$forum['subforums'] = '';
    }
    
$children explode(','$forum['childlist']);
    foreach(
$children AS $childid)
    {
     
$forum['browsers'] += iif($inforum["$childid"], $inforum["$childid"], 0);
    }
    if (
$depth == AND $tempext == '_nopost')
    {
     global 
$vbcollapse;
     
$collapseobj_forumid = &$vbcollapse["collapseobj_forumbit_$forumid"];
     
$collapseimg_forumid = &$vbcollapse["collapseimg_forumbit_$forumid"];
     
$show['collapsebutton'] = true;
    }
    else
    {
     
$show['collapsebutton'] = false;
    }
    
$show['forumsubscription'] = iif ($subsonlytruefalse);
    
$show['forumdescription'] = iif ($forum['description'] != ''truefalse);
    
$show['subforums'] = iif ($forum['subforums'] != ''truefalse);
    
$show['browsers'] = iif ($vboptions['displayloggedin'] AND !$forum['link'] AND $forum['browsers'], truefalse);
    
// build the template for the current forum
    
eval('$forumbits .= "' fetch_template("forumhome_forumbit_level$depth$tempext") . '";');
   } 
// end if (!$subsonly OR ($subsonly AND !empty($forum['subscribeforumid'])))
   
else
   {
    
$forumbits .= $childforumbits;
   }
  }
 }
 return 
$forumbits
If anybody gets a winfall of an idea
__________________



  #9  
Old 08-03-2004, 09:42 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Mod request

So you put the "$show['hideextra'] = true;" in your subscribed.php file and that if condition doesn't work to hide the other stuff afterwards?
  #10  
Old 08-03-2004, 12:00 PM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Wink Re: Mod request

Quote:
Originally Posted by Brian
So you put the "$show['hideextra'] = true;" in your subscribed.php file and that if condition doesn't work to hide the other stuff afterwards?
Yes, I tryed puttng this "$show['hideextra'] = true;" in the subscribed.php and this "<if condition="!$show['hideextra']">" in the template.

but, I pressume it is the placement within the file and template or both.

I'll play with it some more tonight

Thanks again
__________________



  #11  
Old 08-03-2004, 11:39 PM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

Well, I tryed moving these all over the template as well as the file, the only thing I got was nothing, meaning everything disappeared, or everything stayed where it was.

Any more ideas Brian?
__________________



  #12  
Old 08-03-2004, 11:46 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Mod request

So when you added that to the template then everything disappeared? If so, then that's pretty much what should have happened. You can use that variable in the template to remove the other table cells with the info you don't want in that module.
  #13  
Old 08-04-2004, 12:06 AM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

The problem is,
one line was all,
the next was nothing,

Kind of hard to move around I ran out of ideas
__________________



  #14  
Old 08-04-2004, 12:11 AM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

Quote:
Originally Posted by tomshawk
The problem is,
one line was all,
the next was nothing,

Kind of hard to move around I ran out of ideas
OK, I have it narrowed down, it is the $forumbits line for the functions_forumlist.php file.

I was affraid of that.

So, does anybody know how to modify the code above in that post that talks about functions_forumlist.php.

Bascially making another call
__________________



  #15  
Old 08-04-2004, 12:38 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Mod request

Quote:
Originally Posted by tomshawk
The problem is,
one line was all,
the next was nothing,

Kind of hard to move around I ran out of ideas
I'm not entirely sure what you mean by that... I threw a copy on my localhost real quick and it seems to be working fine for me. The only thing I really had to change were my 'forumhome_forumbit_levelX_post' templates. Here's what I've got for mine:

forumhome_forumbit_level1_post
Code:
<tbody>
	<tr align="center">
		<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">
		
		<table cellpadding="0" cellspacing="0" border="0">
		<tr>
			<if condition="!$show['hideextra']"><td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td></if>
			<td>
			<div>
				<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
				<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
			</div>
			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
			<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
			<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
			</td>
		</tr>
		</table>
		
		</td>
		<if condition="!$show['hideextra']"><td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
		<td class="alt1">$forum[threadcount]</td>
		<td class="alt2">$forum[replycount]</td>
		<if condition="$vboptions['showmoderatorcolumn']">
		<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
		</if></if>
	</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
	$childforumbits
</tbody>
</if>

forumhome_forumbit_level2_post
Code:
<tr align="center">
	<if condition="!$show['hideextra']"><td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td></if>
	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
		<div>
			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
		</div>
		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
	</td>
<if condition="!$show['hideextra']">	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
	<td class="alt1">$forum[threadcount]</td>
	<td class="alt2">$forum[replycount]</td>
	<if condition="$vboptions['showmoderatorcolumn']">
	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td></if>
	</if>
</tr>
$childforumbits
Does that help any, or am I missing something?
  #16  
Old 08-04-2004, 03:31 PM
tomshawk's Avatar
tomshawk tomshawk is offline
tech-unity.com
 
Join Date: Jun 2004
Posts: 452
Default Re: Mod request

That was it, I miss read your original post, I was adding it to the template I made adv_portal_subscribed. My Fault Thank you very much.

I will write this up and release it sometime tonight.

Thank you very Brian Excellent Product and excellent help as always
__________________



 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Module Request: v3 Arcade News Intex Add-On Modules & Modifications 3 07-20-2004 06:57 PM
A difficult hack request! News formatting! Morrus Add-On Modules & Modifications 0 06-08-2004 01:14 PM
Module Request: affiliate block Tristan Add-On Modules & Modifications 0 06-07-2004 12:16 PM
Module Request - Analog Clock The Sandman Add-On Modules & Modifications 8 06-06-2004 01:04 PM
Verify Membership Status block - Hack Request joeychgo Add-On Modules & Modifications 0 06-04-2004 01:06 PM


All times are GMT -4. The time now is 06:28 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.