TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 447
  • Total: 447

Tricky Block Request

Started by Xarcell, June 01, 2006, 04:18:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rus

Thank you, that showed me my error exactly.  Being completely new to PHP, I didnt know you needed to echo the table command.

falguni1

this is how it looks for those who dont know


falguni1

#42
this is one of the best snippets

I have a request as you can see I have many child boards and boards and it makes the menu very long

so can the menu be put in 2 columns like
1st column main boards
2nd column child boards



and



like the first column has boards (here all boards from the forum are seen but not child boards)
and the second column has child boards (which are seen when one clicks on the respective father board)

RichardWing

Hello,

Did anyone come up with a 2 or 3 column center block solutions?

I am looking for a way to display a specific board title and then below it the last X amount of posts then do another board title in another column and x amount of last posts below it and repeat this in x amount of columns then move down and do the same for the next board I specify etc...

I guess I could wrap at the end of the main table and move down to the next row.

it would be cool if I could specify in an array or something all the boards we want to show in the center front page block from within the code.

Thanks,
Richard Wing

Madisonianne

Hi...I've been reading through several of these snippet threads and haven't found what I'm looking for - but this comes pretty close...

I'm wanting a list of topics - not boards.  Even better if I can limit that list to just certain boards.  Make sense?  I hope!

JPDeni

Can you describe exactly what you want, please? Pretend that nothing came before this -- that this is a completely new project.

Madisonianne

Thanks for the fast reply! 

Well, ideally, I'd love to have something like this but listing the topics within the boards (as opposed to listing the boards within the categories).  I hope that makes sense!   I'm not sure how to post the code I saw that I liked, I'll give it a try.  Thanks!

Quoteglobal $db_prefix, $context, $user_info;

   if (!isset($context['jump_to']))
   {
   // Find the boards/cateogories they can see.
   $request = db_query("
      SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
      WHERE $user_info[query_see_board]", __FILE__, __LINE__);
   $context['jump_to'] = array();
   $this_cat = array('id' => -1);
   while ($row = mysql_fetch_assoc($request))
   {
      if ($this_cat['id'] != $row['ID_CAT'])
      {
         $this_cat = &$context['jump_to'][];
         $this_cat['id'] = $row['ID_CAT'];
         $this_cat['name'] = $row['catName'];
         $this_cat['boards'] = array();
      }

      $this_cat['boards'][] = array(
         'id' => $row['ID_BOARD'],
         'name' => $row['boardName'],
         'child_level' => $row['childLevel'],
         'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board']
      );
   }
   mysql_free_result($request);
   }

   foreach ($context['jump_to'] as $category)
   {
      echo '<span class="smalltext" style="text-decoration: underline; font-weight: bold;">', $category['name'], '
</span>';
      foreach ($category['boards'] as $board)
         echo '<span class="smalltext"><a href="' . $scripturl . $board['id'] . '.0">'. str_repeat('', $board['child_level'] + 1) . '' . $board['name'] . '</a>
</span>';
   }

Madisonianne

#47
I just found a good example!!!  It's here:

http://www.tinyportal.net/index.php?topic=27012.0

So now what I'd like is for this to be formatting in a table with the poster name and maybe the date. 

I am so sorry if I'm asking a lot!  I'm new to all this php stuff and need all the help I can get. :)  Thanks again!

JPDeni

Okay. Let's start again. :)

What is it that you want? Don't compare it to anything else. Don't tell me what you don't want. Just what you do want. Pretend that no one on the planet has ever written anything that is remotely similar to what you want.

If you've written code that you want me to debug, that's a different thing. You'll have to tell me what the problem is, though.

Madisonianne

:)  Sorry..I'll try again...

I'd like a list of topics from one specific board. 
I'd like it to include the name of the member who started it and the date.
I'd like it in a table.
I'd like it to be ordered descending from most recent topic.
I'd like the last 10.

I feel so bad...I hope this is better...and thank you!!!

This website is proudly hosted on Crocweb Cloud Website Hosting.