Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
php variable into a smarty template variable
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/05/09 00:15 
Im trying to intergrate greywrverns seach script (http://www.greywyvern.com/search?q=index) into jamroom, but im stuck at getting the results into the smarty skin .tpl file for display.


Code
############################################
# THE SEARCH RESULTS
##############################################

   jmHtmlBegin();
    jmBodyBegin();
   
   ob_start();
   include 'modules/apicos_os2/_search.php';   
   $search_results = ob_get_contents();
   ob_end_clean();

   ob_start();
   $_tpl = htmlGetTemplate('template',$_post,'stuff','os2_search.tpl');
   htmlShowTemplate($_tpl['tpl_dir'],$_tpl['template'],$search_results);
   $out = ob_get_clean();
   jrHtmlFormRawText($out);       
   
   jmBodyEnd();
   jmHtmlEnd();


pointers please.

currently _search.php will display the results of the search. I want to take that page and include it into the current design. maybe as a smarty variable something like {$SEARCH_RESULTS}

How would i do that? (I'll keep reading the doc..)


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/05/09 01:13 
Getting closer.
Got the output to display in the skin with the code below:

Code

   jmHtmlBegin();
    jmBodyBegin();
   
   ob_start();
   
   include 'modules/apicos_os2/_search.php';   
   $search_results = array(search_results => ob_get_contents());
   ob_end_clean();

   ob_start();
   
   $_args['tpl_dir'] = 'skin';
   $_args['template'] = 'os2_search.tpl';
      
   $_tpl = htmlGetTemplate('template',$_args);
   htmlShowTemplate($_tpl['tpl_dir'],$_tpl['template'],$search_results);
   $out = ob_get_clean();
   jrHtmlFormRawText($out);       
   
   
   jmBodyEnd();
   jmHtmlEnd();


But it displays inside the users control panel theme. Looking for a way to have it display as the skin.

how do you know what $_args are available? is there an $_arg to make the output display in the skin rather than the control panel?


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/05/09 02:11 
Got it sorted out now.

Was going about it in the wrong way.

needed to create module/(module name)/smarty/function.apOs2_searchResults.php to build a custom smarty function to get it to display in the templates skin.

happy now. Smile


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.