php forum
php mysql forum
php mysql smarty
 
Topic Options
#272513 - 04/17/04 09:31 PM Help Needed
3DSHROOM_dup1 Offline
Journeyman

Registered: 04/17/02
Posts: 108
Loc: Texas
I'm working on a project and have run into something that for my current level of PHP knowledge, would take me a while to figure out. If you can offer any help/tips it would be much appreciated <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /><br />Current related code:<br /><br />[]<br />$cats = array(1,2); <br />unset($cats); <br />$mice = array(1=>array(1,2));<br />unset($mice[0]); <br />unset($mice[1]);<br /><br />// Gather the needed FAQs<br />$result = mysql_query("SELECT uid,title FROM faq WHERE (is_private = 0 AND approved_date_time = '0000-00-00 00:00:00') || (is_private = 1 AND author_uid = " . $rid . ");");<br />for ($i = 0; $i < mysql_num_rows($result); $i++) {<br /> list($uid,$title) = mysql_fetch_row($result);<br /> $cats[$uid] = $title;<br />}<br /><br />// For each FAQ that was gathered above, get the category_tree_uid<br />foreach($cats as $key => $value) {<br /> $khalif = mysql_query("SELECT category_tree_uid FROM faq_category WHERE faq_uid = " . $key . ";");<br /> if(mysql_num_rows($khalif)) {<br /> for ($i = 0; $i < mysql_num_rows($khalif); $i++) {<br /> list($category_tree_uid) = mysql_fetch_row($khalif);<br /><br /> // See if the reseller is subscribed to this category<br /> $res = mysql_query("SELECT user_uid FROM user_sub WHERE user_uid = " . $rid . " AND category_tree_uid = " . $category_tree_uid . ";");<br /> if(mysql_num_rows($res)) {<br /> $mice[$category_tree_uid][$key] = $value;<br /> }<br /> } <br /> }<br />}<br /><br />$fight = array(1,2);<br />unset($fight);<br />foreach($mice as $key => $value) {<br /> $vizier = mysql_query("SELECT name FROM category_tree WHERE uid = " . $key . ";");<br /> list($category) = mysql_fetch_row($vizier);<br />?><br /><h2><?=$category?></h2><br /><?<br /> $fight = $value;<br /> foreach($value as $keys => $values) {<br /> $linkme = $keys;<br /> $title = $values;<br /> ?><br /> <a href="display-faq-detail.php?id=<?=$linkme?>"><?=$title?></a><br><br /> <?<br />}<br />}<br />[/] <br /><br />Pseudocode I've come up with:<br /><br /> [] <br />// For each FAQ - We need to load these types of information into array(s)<br /><br />category_name <- name of the FAQ's parent category<br />category_tree_uid <- id number for the FAQ's parent category<br />key <- id number for the specific FAQ<br />title <- title of the FAQ<br /><br />// Need to sort individual FAQs by category_name, regardless of it's category_tree_uid<br /><br />// Need to output each FAQ:<br />// Display the category_name only once for each group of FAQs with identical category_name<br />// Print link/title<br /> [/] <br /><br />Main things are getting the info into arrays, sorting while keeping related data for each FAQ grouped, cycling through array to print out info.<br /><br />Thanks again for any help. <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
SacredShrooms.org

Top
#272514 - 04/19/04 05:24 PM Re: Help Needed [Re: AleksejVL]
3DSHROOM_dup1 Offline
Journeyman

Registered: 04/17/02
Posts: 108
Loc: Texas
Nevermind..
_________________________
SacredShrooms.org

Top
#272515 - 04/23/04 01:33 PM Re: Help Needed [Re: AleksejVL]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
cats and mice?

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks