The WorksForWeb Community Forums
Welcome to the WorksForWeb community forums. Here you can discuss WorksForWeb products with others and contribute to the rapidly growing WorksForWeb community. Please note that while WorksForWeb staff try to maintain presence on the forums, this is not the most reliable way to contact WorksForWeb staff. In case you require a timely response from WorksForWeb on an issue, please open a support ticket here. For pre-sales questions, please open a sales ticket here.

Welcome, Guest. Please login or register.
May 18, 2012, 12:15:23 PM

Login with username, password and session length
Search:     Advanced search
Added the iLister-related Boards

Rate My Site Boards Added

Merged iAuto and iRealty Support Forums together

Several new tips in the Tips and Tricks section
1,604 Posts in 625 Topics by 1,179 Members
Latest Member: bobsteam
* Home Help Search Login Register
+  The iAuto/iRealty/iLister Support Forum
|-+  iAuto and iRealty v.2.x - 3.x
| |-+  General iAuto Discussions
| | |-+  my_listings/
« previous next »
Pages: [1] Print
Author Topic: my_listings/  (Read 1454 times)
pntkl
Newbie
*

Karma: 1
Posts: 7


View Profile
« on: April 15, 2007, 08:48:10 AM »

Hi,
     I looked through the site's php/tpl files, trying to find out how "my_listings/" is built. The string "my_lisitings" does not appear throughout the site's source. I don't even see how it is added to the signed-in user's left_menu_block. I know there is an insert statement in the installation's .sql file, so my best guess is that I'm not going to find the function so easily. I don't have access to phpMyAdmin, through hosting.
     I am adding a custom module, that I would like only accessible through the signed-in user's individual ads display block. This is where the user can View Details | Save ... Edit Listing | Deactivate Listing. At the very least, I need to know where to add the link; if not see the code in play, as well.

T.J. Wood
Logged
pntkl
Newbie
*

Karma: 1
Posts: 7


View Profile
« Reply #1 on: April 15, 2007, 08:09:11 PM »

I was able to add a link to the logged-in user's individual ad blocks. (For those interested, see P.S.) Now, I am pulling my hair out trying to figure out how to add a custom module. This isn't really explained in the documentation, as far as I can tell. I'm guessing I will need access to the database, but I'm not sure what the proceedure would be to include a custom module.

When I try to access "SITE_URL.'new_page/'," I receive a 404 error. At this point, I'm not sure what else I need to modify or add.

I have created a folder my_module/ in /system/modules/, and I've done my best to replicate the structure of the other modules. I have edited the site root config.php, under the //users comment:

'new_page/' => array (
      'template' => 'index.tpl',
      'module' => 'my_module',
      'raw_output' => false,
      'function' => 'my_function',
      'params' => array(),
   ),

I have created a config.php in my_module/:

<?php

return array
(
   'display_name' => 'Custom Module',
   'description' => 'No description',
   'classes' => 'classes/',
   'functions' => array
   (
      'my_module' => array
      (
         'display_name'   => 'Custom Module',
         'script'      => 'functions/my_function.php',
         'type'         => 'user',
         'access_type'   => array('user'),
      ),   
   ),
);
?>

I have created my_function.php in my_module/user/functions/:
<?php
$template_processor->display('my_page.tpl');
?>

Finally, I have created my_page.tpl in my_module/user/templates/my_template/:

<div align="center">Module Working</div>

At the moment, I would just like to be able to create a custom module. The only thing I need for it to do, at this time, is display the tpl or "echo 'Module Working';" with my_function. Any help with this would be greatly appreciated.

T.J. Wood

P.S.

I was able to find the conditional statements that displays View Details | Save ... Edit Listing | Deactivate Listing, by searching for their text strings through the site root. The code was located in db_search.php ($strings, for the block I needed...$modules, for the Details page) and saved_search.php (Its in here too, but I haven't checked where this is displayed).
Logged
pntkl
Newbie
*

Karma: 1
Posts: 7


View Profile
« Reply #2 on: April 16, 2007, 08:04:04 PM »

I didn't have the patience to see what I was missing. I also don't have the patience to wait for a forum reply. I ended up building what I needed outside of the template. I personally don't like this, even if the client might not care. Any help with my issue creating a custom module would be appreciated. I'm sure other users would like to know the procedure, as well. This is definitely something I would like to see in the documentation.
Logged
Smart Girl
Administrator
Full Member
*****

Karma: 5
Posts: 224


View Profile
« Reply #3 on: April 18, 2007, 03:48:17 PM »

pntkl,

Please see the changes to your code (in red) below:

'new_page/' => array (
      'template' => 'index.tpl',
      'module' => 'my_module',
      'raw_output' => false,
      'function' => 'my_function',
      'params' => array(),
   ),

I have created a config.php in my_module/:

<?php

return array
(
   'display_name' => 'Custom Module',
   'description' => 'No description',
   'classes' => 'classes/',
   'functions' => array
   (
      'my_function' => array
      (
         'display_name'   => 'Custom Module',
         'script'      => 'functions/my_function.php',
         'type'         => 'user',
         'access_type'   => array('user'),
      ),   
   ),
);
?>

I have created my_function.php in my_module/user/functions/:
<?php
$template_processor->display('my_page.tpl');
?>

Finally, I have created my_page.tpl in my_module/user/templates/{here_should_be_the_name_of_the_template}/:

<div align="center">Module Working</div>


Please let me know if it helped you.
Logged

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Classified Software by Worksforweb Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!