Forum Activity for @the-patria-company

PatriaCo
@the-patria-company
02/19/19 11:28:06AM
349 posts

New Custom Account Tab


Jamroom Developers

PROBLEM: I am using the form designer to create custom ($profile_???) fields. Now I have too many, so the [Profile] form is getting congested and losing its user-friendliness.

QUESTION: I have created a custom module with a schema.php & includes.php. I am now looking through the OneAll module and Tweaks module (index.php) for clues on how to create the actual account form page. If I wanted just a blank page that included the [form designer] what code do I need to add to my custom module's index.php?
updated by @the-patria-company: 06/12/19 10:32:43PM
PatriaCo
@the-patria-company
02/12/19 10:46:00AM
349 posts

Internal Jamroom Ads Manager


Suggestions

I seem to remember (in a former Jamroom life) that an internal ads manager existed. Has anyone ever considered creating an Ads Manager module?
updated by @the-patria-company: 05/14/19 02:51:39PM
PatriaCo
@the-patria-company
01/20/19 12:08:23PM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

Thank you for the help!

I am trying to learn PHP as quickly as possible; however, many times my needs exceed my abilities.

This solution is going to work out very nicely. Thank you again!!
PatriaCo
@the-patria-company
01/16/19 01:43:09PM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

Great! That will be much easier. Earlier in this thread I attempted to write such a code, but I know I am off by a bit.

PatriaCo:
OK, so I have my schema set up and I simply want to add a directory of pages to the datastore. I also want the integrity check to check the directory so that if any changes are made to the module's index.php (such as adding cities) that the datastore will not contain duplicates.

My module's index.php (with the proposed save to datastore function)
function view_myCustomModule_default($_post, $_user, $_conf)
{ switch ($_post['option']) { case'my-custom-module-page-houston': case'my-custom-module-page-chicago': case'my-custom-module-page-new-york': return jrCore_parse_template('my-custom-module-page.tpl', $_rep, 'myCustomModule'); break; } } //------------------------------ // create pages directory in datastore //------------------------------ function view_myCustomModule_create_dir($_post, $_user, $_conf)
{ $_sv = array( 'page' => "{$_conf['jrCore_base_url']}/{$url}/my-custom-module-page-houston", ); $_sv = array( 'page' => "{$_conf['jrCore_base_url']}/{$url}/my-custom-module-page-chicago", ); $_sv = array( 'page' => "{$_conf['jrCore_base_url']}/{$url}/my-custom-module-page-new-york", ); }

Am I going in the right direction? I don't need to "view" the function, but I am not sure of the right syntax to use here. Thanks for the help. :)

updated by @the-patria-company: 01/16/19 01:44:28PM
PatriaCo
@the-patria-company
01/14/19 03:56:51PM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

It does make sense; except, the pages I am searching for are not profiles. The pages that I need to add to the module's datastore were pseudo-created via the module's include.php by adding them to the sitemap via the hardcoded function that you helped me with:

https://www.jamroom.net/the-jamroom-network/forum/my_posts/59966/custom-module-pages-in-sitemap
updated by @the-patria-company: 01/14/19 03:57:16PM
PatriaCo
@the-patria-company
01/14/19 03:34:43PM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

OK, I am going to give this a try :) I hope I am close. Areas, where my php is very weak, are notated in dbl ?? Thanks again for helping me through my learning curve.

function myCustomModule_createPageDirectoryInDatastore($_data, $_user, $_conf, $_args, $event)
{ $curl = curl_init(); //Determine the number of Sitemaps to Parse from ($jamroom_url)/sitemap.xml $smurl = "{$_conf['jrCore_base_url']}/sitemap.xml"; curl_setopt($curl, CURLOPT_URL, $smurl); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $smresult = curl_exec($curl); $sitemaps = array(); preg_match_all('!<loc>{$_conf['jrCore_base_url']}\/sitemap\/sitemap(.*?).xml<\/loc>!',$smresult,$match); $sitemaps['map'] = $match[1]; $smcount = count($sitemaps); //Begin parsing sitemaps and finding url matches for the module that we are searching for $murl = jrCore_get_module_url('myCustomModule'); //Open each sitemap xml page and begin parsing for (// ?? repeat $smcount ??) $url = "{$_conf['jrCore_base_url']}/sitemap[//?? $sitemaps array numerical entry for 'map' ??].xml"; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); $pages = array(); //This should capture our page data to add to the array preg_match_all('!<loc>{$_conf['jrCore_base_url']}\/{$murl}\/(.*?)<\/loc>!',$result,$match); $pages['name'] = $match[1]; //Check Datastore for duplicates and remove from array ?? ?? //Enter new $pages array results into the module's datastore ?? ?? }

Lastly, I would like to create a button that initiates the function in the "Tools" tab (which was automatically created with the module's datastore). Could I also get some help with that, please?
updated by @the-patria-company: 01/14/19 04:14:45PM
PatriaCo
@the-patria-company
01/14/19 09:07:38AM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

PERFECT!

So this goes back to my earlier question of the best way to populate the datastore. Is there a way to bulk import or hardcode or take the data that I want to add from the sitemap module? Adding them one at a time via a form would take a very long time.
PatriaCo
@the-patria-company
01/14/19 07:51:40AM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

I am probably not understanding something, sorry. I have two goals.

#1. I want the pages from my module to be available in the jrSearch Results

#2. I want to access each page title and url using {jrCore_list

There are only two places where I can find the data containing my list of pages, (1) hard-coded into my module's include.php function and (2) in the Sitemap xml file. I was hoping I could tap into a sitemap datastore, but that was a no-go.

Is it even necessary to get this data into my module's datastore, or is it already available somewhere else, via the sitemap module?
PatriaCo
@the-patria-company
01/13/19 08:32:23PM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

Yes, @michael I completely agree. I am just unsure of the best way to enter the over 5000 entries. If I could "harvest" the page urls from the sitemap and add them to the datastore using a simple search query that would be great.

Another thought I had was connected to the fact that I am already adding the pages to the site map via a function in my module.

Is there a similar statement that I can code to add these same urls directly into the datastore?

Can I add something like this to my module's include.php?

function myCustomModule_addURLToDataStore_save($_post,  &$_user,  &$_conf)
{ $url = jrCore_get_module_url('myCustomModule'); $_data[] = "{$_conf['jrCore_base_url']}/{$url}/birmingham-alabama-electricians"; $_data[] = "{$_conf['jrCore_base_url']}/{$url}/montgomery-alabama-electricians"; $_data[] = "{$_conf['jrCore_base_url']}/{$url}/huntsville-alabama-electricians"; $_data = jrCore_form_get_save_data('myCustomModule', 'create', $_post); }

I can see from other modules that a view function is used in the index.php file of the module, as the data is being saved from a form, but I do not need a form as I would like to hard code the URLs that I want to be added to the datastore. Similar to the way that I added the list of URLs to the Sitemap. I know that my code is not correct, but I hope that I am getting close. I would also like to make sure that this way of adding data into the datastore does not produce duplicates.

Any assistance would be greatly appreciated. THANKS!!
PatriaCo
@the-patria-company
12/30/18 06:39:39AM
349 posts

Make Custom Module Pages Searchable


Jamroom Developers

Thanks @michael


So I see three possibilities, but I am not sure of the best way.

#1. I could make an admin only page view with a form (that allows multiple data entries at once).
or
#2. I could hard code the data to enter from the module's index.php, but that could lead to an unnecessarily large file.
or
#3. I could have the module search the sitemap and create the datastore entries. (not sure if this is possible)

Which of these options is the best to pursue?
  4