Not logged in. · Lost password · Register
Forum: Support Ideas and suggestions RSS
printing forum - subforum - post titles in search results
just a set of loops
englishextra #1
Member since Jul 2008 · 3 posts
Show profile · Link to this post
Subject: printing forum - subforum - post titles in search results
Where $query_text is a search string; Mysql connections and closings are omitted:

$select_unb_posts=mysql_query("SELECT ID, Thread, Subject, Msg FROM $unb_posts_table_name WHERE Subject LIKE '%$query_text%' OR Msg LIKE '%$query_text%' AND Subject!='';");
$mysql_num_rows_select_unb_posts=@mysql_num_rows($select_unb_posts);
if ($mysql_num_rows_select_unb_posts > 0) {
    while ($mysql_fetch_row_select_unb_posts=@mysql_fetch_row($select_unb_posts)) {
        $select_unb_threads=mysql_query("SELECT Forum FROM $unb_threads_table_name WHERE ID='".$mysql_fetch_row_select_unb_posts[1]."';");
        $mysql_num_rows_select_unb_threads=@mysql_num_rows($select_unb_threads);
        echo "<div><p>";
        if ($mysql_num_rows_select_unb_threads > 0) {
            while ($mysql_fetch_row_select_unb_threads=@mysql_fetch_row($select_unb_threads)) {
                $select_unb_forums=mysql_query("SELECT Parent, Name FROM $unb_forums_table_name WHERE ID='".$mysql_fetch_row_select_unb_threads[0]."';");
                   $mysql_num_rows_select_unb_forums=@mysql_num_rows($select_unb_forums);
                if ($mysql_num_rows_select_unb_forums > 0) {
                    while ($mysql_fetch_row_select_unb_forums=@mysql_fetch_row($select_unb_forums)) {
                        $unb_subforum_title=$mysql_fetch_row_select_unb_forums[1];
                        $select_unb_forums=mysql_query("SELECT Name FROM $unb_forums_table_name WHERE ID='".$mysql_fetch_row_select_unb_forums[0]."' LIMIT 1;");
                           $mysql_num_rows_select_unb_forums=@mysql_num_rows($select_unb_forums);
                        if ($mysql_num_rows_select_unb_forums > 0) {
                            while ($mysql_fetch_row_select_unb_forums=@mysql_fetch_row($select_unb_forums)) {
                                $unb_forum_title=$mysql_fetch_row_select_unb_forums[0];
                                if ($unb_forum_title!="") {
                                    echo $unb_forum_title." - ";
                                }
                                if ($unb_subforum_title!="") {
                                    echo $unb_subforum_title." - ";
                                }
                            }
                        }
                    }
                }
            }
        }
        echo $mysql_fetch_row_select_unb_posts[2]."...</p></div>\r\n";
    }
}
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
What does that mean?
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
englishextra 2 (Guest) #3
No profile available.
Link to this post
This prints two last forum titles referring to the post that matches search results on the search page which is not integrated in unb.

PS By the way a received a rather strange message from this forum telling me something about changing my email in registration data. Why? And what does that mean?

Also I didn't receive any message when i requested a new password to change the email as your forum asked for

Bad

englishextra
Avatar
Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Aha. Well, to whom it may be useful.

Please do not hijack threads for different topics. Just that much: Your mail server doesn't like mine and rejects everything.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 162.2 ms (104.9 ms) · 59 database queries in 108.7 ms
Current time: 2013-05-20, 07:26:47 (UTC +02:00)