PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Donovan
Client


Joined: Oct 07, 2003
Posts: 688
Location: Ohio

PostPosted: Fri Oct 05, 2007 12:37 pm Reply with quote Back to top

I have started modifying a custom built application at work and have a couple issues. The guy that built this thing is long gone. I can tell he based it heavily off of phpBB as the code looks very familiar. I can see comments throughout that reference phpBB.

Anyway..

I am putting together a reporting feature. I have a working link to the reports in the menu. I have a template installed that is viewable.

My problem is getting the selections in a popup, that is based on a template as well, to refresh the index.php page and display all questions with their corresponding statistics.

So far I'm just working on displaying the questions and will do the stats later.

The popup lets you select the course and createdby (user_id) of all the questions in the database.

Here is some of my code.
Only registered users can see links on this board!
Get registered or login to the forums!


the template that goes with this
Only registered users can see links on this board!
Get registered or login to the forums!


This following is the popup that is used to make the selections of course and user (author of the questions) which is done by using list boxes.
Only registered users can see links on this board!
Get registered or login to the forums!


and its template
Only registered users can see links on this board!
Get registered or login to the forums!


I'm thinking I will need three pages instead of just two. A getinfo.tpl along with getinfo.php, then a viewquestion along with its template file and lastly the index.php with would hold the original menu.

The problem is index is already displayed with the popup viewquestion on top. If I send the variables back to index I would need to refresh the page.

My non-existent knowledge of the term $template->assign_block_vars is a pain in my neck.
View user's profile Send private message Visit poster's website ICQ Number
Donovan
Client


Joined: Oct 07, 2003
Posts: 688
Location: Ohio

PostPosted: Tue Oct 09, 2007 7:28 am Reply with quote Back to top

So does anybody know why this wont work?

Code:
$template->set_filenames(array(
         'body' => 'reports/viewquestions_body.tpl')
      );   


      //Start
            
            $result = $db->sql_query("SELECT * FROM ".QUESTIONS_TABLE." q
            JOIN ".COURSE_TABLE." c ON (q.course_id = c.course_id)
            JOIN ".USERS_TABLE." u ON (u.user_id = q.createdby)
            WHERE q.course_id = ".$course_id." AND q.createdby = ".$user_id."");            
            
            if (!$result) {
      echo("<p>Error performing query: " . mysql_error() . "</p>");
            exit();   
            }      
      
      while ($question = $db->sql_fetchrow($result))    {


I then assign my variables
Code:

$template->assign_block_vars('question',array('qno' => $i, 'qid' => $question['question_id'],
                                 'NAME' => $question['ques_name'],
                                 'STEM' => nl2br($question['stem'])."<br>",
                                 'MEDIA' => $media."<br>",
                                 'FEED' => $question['feedback']."<br>"));



And in the end I generate the page.

Code:

$template->pparse('body');


All that comes up is the shell of the template with no data.
View user's profile Send private message Visit poster's website ICQ Number
Donovan
Client


Joined: Oct 07, 2003
Posts: 688
Location: Ohio

PostPosted: Fri Oct 12, 2007 9:20 am Reply with quote Back to top

Made some changes to try and get this working.

My main index page
Only registered users can see links on this board!
Get registered or login to the forums!


the template that goes with this
Only registered users can see links on this board!
Get registered or login to the forums!


Where I can bring up the popup to select the courses and createdby (author of the questions)
Only registered users can see links on this board!
Get registered or login to the forums!


and its template
Only registered users can see links on this board!
Get registered or login to the forums!


Which sends me to the page to view all the questions from the course selected by author.
Only registered users can see links on this board!
Get registered or login to the forums!


and its template
Only registered users can see links on this board!
Get registered or login to the forums!


I think my issue resides with the assign_block_vars not working as intended.

I can manually assign values

$media = $question['stem'];

then echo these out but am unable to pass these using the

assign_block_vars so they appear in the template.

This phpBB template engine is difficult for me to understand but that is what the previous developer used.

There are over 4000 questions from probably 100 authors in the database.

As always thanks for any assistance.
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum