Return to the CurtPalme.com main site CurtPalme.com Home Theater Forum
A forum with a sense of fun and community for Home Theater enthusiasts!
Products for Sale ] [ FAQ: Hooking it all up ] [ CRT Primer/FAQ ] [ Best/Worst CRT Projectors List ] [ Setup Tips & Manuals ] [ Advanced Procedures ] [ Newsletters ]

 
Forum FAQForum FAQ   SearchSearch   MemberlistMemberlist  Photo AlbumsPhoto Albums  RegisterRegister 
 MembershipClub Membership   ProfileProfile   Private MessagesPrivate Messages   Log inLog in 
Blu-ray disc release list and must-have titles. Buy the latest and best Blu-ray titles to show off in your home theater!

Drop-down sub-forum list?

 
Post new topic   Reply to topic   Printer-friendly view    CurtPalme.com Forum Index -> Forum Feedback
View previous topic :: View next topic  
Author Message
ChrisWiggles
Opinionated SOB


Joined: 12 Mar 2006
Posts: 2529
Location: Seattle


PostLink    Posted: Fri Sep 21, 2007 2:13 am    Post subject: Drop-down sub-forum list? Reply with quote


        Register to remove this ad. It's free!
Say, does the drop-down subform list not work for anyone else? Whenever I select a subforum, and click go, it always takes me to the CRT Projector sub forum. To visit any of the other subforums I have to go to the index and the click the link, the drop-down menu doesn't work for me. Just wondering if that's only me, or if others have this same problem?

-chris
Back to top
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Fri Sep 21, 2007 3:55 am    Post subject: Reply with quote

Oh crap. That reminds me that I need to fix this feature (I seem to have broken it some time ago ...). Either fix it or remove it.... Smile

So yes, it's broken. I've added it to my TODO list.

Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
AnalogRocks
Forum Moderator


Joined: 08 Mar 2006
Posts: 25391
Location: Toronto, Ontario, Canada

TV/Projector: Sony 1252Q, AMPRO 4000G


PostLink    Posted: Fri Sep 21, 2007 5:45 am    Post subject: Reply with quote

We have/had a drop down list?
_________________
Tech support for nothing

CRT.

HD done right!
Back to top
View user's photo album (27 photos)
ChrisWiggles
Opinionated SOB


Joined: 12 Mar 2006
Posts: 2529
Location: Seattle


PostLink    Posted: Fri Sep 21, 2007 5:12 pm    Post subject: Reply with quote

I was fiddling around with it Kal, and I don't understand, it works sometimes, but usually not. And when it doesn't it returns me to the same sub-forum. So I dunno, it's a weird one that's for sure! I just wanted to make sure I wasn't crazy! Smile
Back to top
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Fri Sep 21, 2007 5:47 pm    Post subject: Reply with quote

Yep. It works in some places and not others... seems to be page specific. Probably not a big deal to fix it, but since nobody seems to use it much I haven't felt the pressure. Smile

Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
ryan



Joined: 10 Mar 2006
Posts: 13
Location: Pennsylvania, USA


PostLink    Posted: Sat Sep 22, 2007 5:00 am    Post subject: Reply with quote

Looks like a pretty simple fix...

There's a nested form in viewforum.php (which, in turn, appears to be in templates/subSilver/viewforum_body.tpl).

If you move the closing tag for the unnamed "post" form on line 197 so that it's before {JUMPBOX} (say up to line 178 maybe), I think it should work.

Obviously double-check that won't break anything else first Smile.

-- Ryan

P.S. As a random aside, you may or may not also want to consider removing the "highly recommended" from line 38 of templates/subSilver/overall_footer.tpl Wink.
Back to top
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Sat Sep 22, 2007 12:22 pm    Post subject: Reply with quote

Thanks Ryan! Wow... I think I found someone to help out with my phpBB mods. Smile

And yes... the highly recommended needs to go! (or changed to "ABSOLUTELY DOES NOT recommend"). To everyone else: Ryan's referring to the line to 1&1 - our hosting provider.

Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
jask



Joined: 17 Mar 2006
Posts: 8825
Location: kamloops BC


PostLink    Posted: Sat Sep 22, 2007 7:56 pm    Post subject: Reply with quote

kal wrote:
Oh crap. That reminds me that I need to fix this feature (I seem to have broken it some time ago ...). Either fix it or remove it.... Smile

So yes, it's broken. I've added it to my TODO list.

Kal


Kal I wish the ratio of done portion of my to do list to the remaining todo looked that good Thumbs Up

Thanks again for all the work that we never get to see.
Back to top
View user's photo album (4 photos)
ryan



Joined: 10 Mar 2006
Posts: 13
Location: Pennsylvania, USA


PostLink    Posted: Wed Sep 26, 2007 4:12 am    Post subject: Reply with quote

I took a look at the last few TODO items left and, if you're interested, I think they might be relatively painless to fix/implement...

But firstly, some Caveats and Disclaimers:
  • I know just enough HTML/CSS/PHP/SQL to be dangerous.
  • This has been quickly tested with PHP 5.2.3, MySQL 5.0.45, and phpBB 2.0.22.
    The suggestions may or may not work with other versions, or because of other MODs already installed.
  • I believe this code to be both working and secure, however, I can not be held responsible for any loss incurred due to it's failure (even if the issue would be both obvious and egregious to someone who knows what they're doing).
  • It is worth exactly what I'm charging, which is $0.
  • Feel free to use, not use, and/or modify it in any way.
  • In a nutshell, use only at your own risk.

kal wrote:
Fix redirect after post/edit to go right to the post in question instead of to top of thread (this one's more complex than it sounds).
As far as I can tell, isn't this already working? (In fact it now appears to be the default behavior, at least with phpBB 2.0.22.)

kal wrote:
Jump to forum drop-down doesn't work in some places... need to investigate.
It doesn't look like anything would be broken by moving </form> from line 197 to line 178 in templates/subSilver/viewforum_body.tpl, so that's still what I'd suggest.

kal wrote:
Printer friendly view doesn't seem to always work right with really big threads. Investigate...
This is only available to Club Members (i.e. I'm not even sure what the output looks like when it's working, let alone when it's not Smile), but a total guess would be that you may be hitting the PHP memory_limit, or possibly max_execution_time. In the former case, you could try:
Code:
//... Look for a block of code like, or similar to, the following: ...//
if(isset($HTTP_GET_VARS['printertopic']))
{
   // Add the line below, where 16M is instead maybe twice whatever the current memory_limit is.
   ini_set('memory_limit', '16M');
   //... Leave Existing Code Here ...//
};
Are there any entries in the PHP error log when it breaks?
Would it be possible for someone to post a screen capture and/or the script's output (just a Save As... [HTML Only] would be fine) from a thread long enough to break it?

kal wrote:
User name search in memberlist page.
This one's a bit harder... I couldn't find an existing MOD, but here's a relatively simple method that seems to work fine with phpBB 2.0.22:

Make the following changes to memberlist.php:

Add this between the "Memberlist sorting" and "Generate page" sections:
Code:
//
// Find a member by username.
//
$unsafe_search = ''; $safe_search = ''; $where_clause = '';   // Initialize the variables.
$paginate_link = "memberlist.$phpEx?mode=$mode&amp;order=$sort_order";   // Set the default base link for pagination.
if ( $mode != 'topten' )   // Check that we're not in "Top Ten" mode, where username search makes no sense.
{
   if ( isset($HTTP_POST_VARS['search_username']) )   // Check if the POST variable is set (from Search button).
      { $unsafe_search = $HTTP_POST_VARS['search_username']; }   // Assign it to UNSAFE.
   else if ( isset($HTTP_GET_VARS['search_username']) )   // Or if the GET variable is set (from pagination links).
      { $unsafe_search = $HTTP_GET_VARS['search_username']; };   // Assign it to UNSAFE.
   // Shorten the length to 25 characters and eliminate non-alphanumerics, _, or -.
   $unsafe_search = preg_replace('/[^a-zA-Z0-9_-]/', '', substr($unsafe_search, 0, 25));
   if ( strlen($unsafe_search) > 0 )   // Check if we still have an acceptable search.
   {
      $safe_search = $unsafe_search;   // Assign the verified UNSAFE to SAFE.
      $where_clause = " AND username LIKE '%$safe_search%'";   // Then generate an SQL WHERE statement.
      $paginate_link .= "&amp;search_username=$safe_search";   // Append the search_username to the base link for pagination.
   };
};

Add/change this in the "Generate page" section:
Original:
Code:
$template->assign_vars(array(
   //... Any Variables Not Listed Should Remain Unchanged ...//
   'L_ORDER' => $lang['Order'],
   'L_SUBMIT' => $lang['Sort'],
   
   'S_MODE_ACTION' => append_sid("memberlist.$phpEx"))
);
New:
Code:
$template->assign_vars(array(
   'L_ORDER' => $lang['Order'].':',   // Add the missing colon to localized "Order".
   'L_SUBMIT' => $lang['Search'],   // Set the submit button text to localized "Search".

   'S_MODE_ACTION' => append_sid("memberlist.$phpEx"),

   'S_MEMBER_SEARCH' => $safe_search,   // Populate a variable for the username search text entry (i.e. when the page is reloaded).
   'S_NO_RESULTS' => '')   // Used to display an error if no results where found.
);

Change the WHERE clause in the SQL query:
Code:
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
   FROM " . USERS_TABLE . "
   WHERE user_id <> " . ANONYMOUS . "
   ORDER BY $order_by";
To:
Code:
WHERE user_id <> " . ANONYMOUS . $where_clause . "   // Include the search_username WHERE clause.

At the end of:
Code:
if ( $row = $db->sql_fetchrow($result) )
{
   $i = 0;
   //... A Lot of Code to Retrieve and Format the Member Data ...//
   $db->sql_freeresult($result);
}
Add this else statement:
Code:
else
{
   $template->assign_vars(array('S_NO_RESULTS' => $lang['No_such_user']));   // There were no members to display.
};

Change the WHERE clause in the SQL query:
Code:
   $sql = "SELECT count(*) AS total
      FROM " . USERS_TABLE . "
      WHERE user_id <> " . ANONYMOUS;
To:
Code:
WHERE user_id <> " . ANONYMOUS . $where_clause;   // Include the search_username WHERE clause here, too.

At the end of:
Code:
if ( $row = $db->sql_fetchrow($result) )
{
   $i = 0;
   //... A Lot of Code to Retrieve and Format the Member Data ...//
   $db->sql_freeresult($result);
}
Add this else statement:
Code:
else
{
   $template->assign_vars(array('S_NO_RESULTS' => $lang['No_such_user']));   // There were no members to display.
};

Change the line:
Code:
$total_members = $total['total'];
To:
Code:
$total_members = ($total['total'] > 0) ? $total['total'] : $board_config['topics_per_page'];   // Handle the case of zero results.

Change the line:
Code:
$pagination = generate_pagination("memberlist.$phpEx?mode=$mode&amp;order=$sort_order", $total_members, $board_config['topics_per_page'], $start). '&nbsp;';
To:
Code:
$pagination = generate_pagination($paginate_link, $total_members, $board_config['topics_per_page'], $start) . '&nbsp;';


Make the following changes to templates/subSilver/memberlist_body.tpl:

On line 6 change:
Code:
<td align="right" nowrap="nowrap"><span class="genmed">{L_SELECT_SORT_METHOD}:&nbsp;{S_MODE_SELECT}&nbsp;&nbsp;{L_ORDER}&nbsp;{S_ORDER_SELECT}&nbsp;&nbsp;
To:
Code:
<td align="right" nowrap="nowrap"><span class="genmed">Username:&nbsp;<input type="text" name="search_username" size="20" maxlength="25" value="{S_MEMBER_SEARCH}">&nbsp;&nbsp;{L_SELECT_SORT_METHOD}:&nbsp;{S_MODE_SELECT}&nbsp;&nbsp;{L_ORDER}&nbsp;{S_ORDER_SELECT}&nbsp;&nbsp;

On line 37 change:
Code:
<td class="catBottom" colspan="9" height="28">&nbsp;</td>
To:
Code:
<td class="catBottom" colspan="9" height="28" align="center">&nbsp;{S_NO_RESULTS}&nbsp;</td>


Then, with any luck, that should do it. Of course if anything blows up, don't forget the disclaimer. Smile

-- Ryan
Back to top
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Wed Sep 26, 2007 5:30 pm    Post subject: Reply with quote

Wow Ryan - Thanks! I'll take a look once I get a chance.

What are you using as the code-base when doing these comparisons? My current phpBB version is exactly one version behind and I've got 100's of mods already installed in most files so the line numbers wouldn't be the same.
You can view TPL files directly of course (if you know what to look for) but that's only display stuff. Trying to look at PHP files directly doesn't work.

Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
ryan



Joined: 10 Mar 2006
Posts: 13
Location: Pennsylvania, USA


PostLink    Posted: Thu Sep 27, 2007 2:45 am    Post subject: Reply with quote

kal wrote:
Wow Ryan - Thanks! I'll take a look once I get a chance.
No problem... And do feel free to use or modify it however you see fit. Or not use it all if it isn't what you were looking for.

kal wrote:
What are you using as the code-base when doing these comparisons? My current phpBB version is exactly one version behind and I've got 100's of mods already installed in most files so the line numbers wouldn't be the same.
The changes above were written for and tested against an unmodified install of phpBB v2.0.22. It looks like there's been only minor changes to memberlist.php at least as far back as v2.0.19. The one difference (in the sections that would need to be modified for implementing a simple search, anyway) I can see is going to be from the Last Visit MOD. Theoretically, though, my suggestions should still be valid. (Example: The modifications made by Last Visit definitely effect the first SQL query I mention, but those changes only apply to the SELECT columns... The WHERE clause can [probablySmile] still be changed as suggested.)

kal wrote:
You can view TPL files directly of course (if you know what to look for) but that's only display stuff.
The line numbers mentioned in reference to templates/subSilver/viewforum_body.tpl and templates/subSilver/memberlist_body.tpl were for the files being used on this site (at least at the time my message was posted).

kal wrote:
Trying to look at PHP files directly doesn't work.
Indeed, which is why I couldn't provide any specific line numbers to alter them. You'll have to find the relevant lines/sections by hand, sorry Sad. I put them in order from the top down, though, so I hope it's reasonably easy to figure out what should be where even with many other MODs installed. Alternately, I could attempt to translate those changes into an actual MOD file myself.

A few other caveats I should mention (of course, they can all be changed/fixed if required) in regard to the username search:
  • My code doesn't quite adhere (in mostly cosmetic ways) to phpBB coding guidelines.
  • The handling of user input differs somewhat from the way search.php works. For better or worse, depending on your point of view:
    • The "purifying" regular expression just gets rid of anything that's not a letter, number, underscore, or hyphen.
      (Which may prevent searching for some usernames, or make it more difficult than it needs to be.)
    • There's a hard-coded wildcard at the beginning and end of the search string.
      (Meaning it will find a match that occurs anywhere in the username.)
  • This line:
    Code:
    $total_members = ($total['total'] > 0) ? $total['total'] : $board_config['topics_per_page'];
    Can be just:
    Code:
    $total_members = ($total['total'] > 0) ? $total['total'] : '1';
    While it does work as originally posted, I initially misunderstood the intention because of a bug (not mine) in that section of code.
    A quick, useless summary (since it shouldn't effect this board):
    • If $board_config['topics_per_page'] is set to less than 10 and 'topten' mode is selected, then $total_members (and subsequently $pagination) actually gets count(*) for all users instead of 10. Hrm.

-- Ryan
Back to top
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Thu Sep 27, 2007 3:02 am    Post subject: Reply with quote

ryan wrote:
You'll have to find the relevant lines/sections by hand, sorry Sad. I put them in order from the top down, though, so I hope it's reasonably easy to figure out what should be where even with many other MODs installed. Alternately, I could attempt to translate those changes into an actual MOD file myself.

Oh god no, please don't do that! That would be an enormous amount of work for you! Just to make sure you know, most of the things left on my TODO list aren't there because I don't know how to do them... just the opposite: They're just ideas and things I add to the list as I remember and when I have some free time (rare) I take a look. So please don't spent too much time as I know how much time this stuff takes. Just the stuff you've already provided is a few hours of work!

Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Thu Oct 25, 2007 7:47 pm    Post subject: Reply with quote

The drop-down sub-forum thingy is now fixed! Thanks to ryan for his clever sleuthing... he pointed me in the right direction!

Ryan: I've made you an honorary club member - it's the least I can do!

Now on to the other things that need fixing...


Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
kal
Forum Administrator


Joined: 06 Mar 2006
Posts: 15671
Location: Ottawa, Canada

TV/Projector: JVC DLA-RS56


PostLink    Posted: Fri Oct 26, 2007 3:46 pm    Post subject: Reply with quote

I've implemented the username search feature that ryan documented above on the memberlist page (with a couple of minor changes).

Works great. You can enter any text and it'll filter the list. It works in conjunction with the other filters up there, so you could for example (though I don't know why) list the top posters with the word "guy" in their username:

Code:
 1     cabinetguy    387   
 2     AvgOrdinaryGuy    74   
 3     tubesguy    17   
 4     the_avguy   16   
 5     Programguy    11   
 6     hotguy8289     10   
 7     Soupguy    3   
 8     viguy    2   
 9     nguyennd  2   
 10     pjguy    1   
 11     silentsoundguy32  1   
 12     wvpinballguy     0   
 13     ps3 guy    0


"PS3 GUY" is going to have to busy if he wants to catch up to "CABINETGUY". Smile

Thanks again Ryan!

Kal

_________________

Support our site by using our affiliate links. We thank you!
My basement/HT/bar/brewery build 2.0
Back to top
View user's photo album (18 photos)
Display posts from previous:   
Post new topic   Reply to topic   Printer-friendly view    CurtPalme.com Forum Index -> Forum Feedback All times are GMT
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum