how to find folder path by using url in phpfox? - phpfox

Please help to find out the url in phpfox
I am new in phpfox.
i have stuck in to find folder and file in phpfox. Actually it contain
multiple files and folders. Please help to find out the file of given using url
http://www.desimitro.com/index.php?do=/pfoxmapi/event/events/when_upcoming/show_15/page_1/username_ashish243

The module is "pfoxmapi" (so the path starts in /module/pfoxmapi/) but besides that the rest of the url could be a param to the "index" controller or a param to /module/pfoxmapi/event/index.class.php. My advise is to contact the developer of that module and ask for guidance.

If the module already existed, then add module name after index.php?do=/{module name}.
eg: index.php?do=/poll. If ur creating a new module then 1st create a module in phpfox my admin and then try

http://www.desimitro.com/index.php?do=/pfoxmapi/event/events/when_upcoming/show_15/page_1/username_ashish243
In this url "http://www.desimitro.com/index.php?do=" is the root path .
And "/pfoxmapi/" denote to the module pfoxmapi created in module folder.
"/event/" is the sub page in this module and rest of the parameters are the variables.

Related

REST API URL with Directory and File name as Path Variables

I have a requirement to send the folder details in the URL for POST method, some thing like this
http:///{directory}/{filename}
I am using Spring API to create the service. Using #PathVariables to two variables in the URI.
Problem : Directory can have "/" slashes in it.
Now how can I create my API, please help me.
POST http://example.com/api/files/path/to/my/file/filename
Stick a controller on /api/files. Scrape the URL starting after /files. Use that to locate the file.
P.S. This has the potential to be a Very Bad Idea. Make sure you secure the controller to only expose those parts of your filesystem you don't mind random internet strangers to be able to operate on.

MEAN stack add new module

I created new module with name "mean.recipes". But it's javascript files are not loaded.
I am missing injection of dependency to load those modules but not able to find the place.
I went through javascript files but could not find the exact file.
can someone point me to right file ?
Starting with the documentation helps.. If it's MEAN.io you can find more information here: http://learn.mean.io/#mean-stack-packages-dependency-injection

How to view drupal 7 sessions from an external PHP page?

I installed drupal 7 and I need to include a block of PHP code in the user profile page.
I created a new block and I put this code in it:
"include (http://mysite/sites/all/themes/campi_aggiuntivi.php)"
In "campi_aggiuntivi.php" I put the following code:
session_start ();
print_r ($ _SESSION);
But it returns an empty array.
How do I interact with drupal sessions in this external page?
Thank you very much for your answares.
Thank you all for your answers.
I'm trying to install a module and insert it into a block avege as I suggested.
I created the file test.info
name = Test Block
description = description Test Block
package = package Test Block
core = 7.x
dependencies[] = block
; Information added by drupal.org packaging script on 2013-02-01
version = "7.x-1.x-dev"
core = "7.x"
project = "Test Block"
datestamp = "1359680350"
But I can not figure out which function I put in the file test.module, to insert the test module management screen Blocks
Can you help me please?
Thank you again to all
I think you need to include Drupal Bootstrap and a few other necessary procedures. Here's a link to an issue on d.o that might help.
1st thing i want to suggest is don't include like this:
"include (http://mysite/sites/all/themes/campi_aggiuntivi.php)"
Use local path instead: "include (sites/all/themes/campi_aggiuntivi.php)"
But this depends on from where you are calling, if both the files are at same location(calling in user profile tpl file) then this might work: "include (campi_aggiuntivi.php)"
I presume you need session details to figure-out the user id, that information can be retrieved from $profile variable or arg(1)
I have not tested your code but the way you are trying to do is not the conventional way to extend Drupal functionality.
Also i hope print_r ($ _SESSION); is actually print_r ($_SESSION); in your code, i.e. without spaces.
If you want to add a block in user profile page, i recommend doing it the drupal way.
Drupal already has an excellent example for creating a block programmatically. Here is the link.
Have a look at block_example module inside it. It will give you relevant example codes that you can use to create the block.
The example also contains information about how to make the block appear in certain pages by default.
After you create the block place them in the region you would want to, like left sidebar, content etc of the relevant theme that is enabled on user profile pages.
Inside your custom module you would access to $_SESSION variable.
From here on you can include the code in campi_aggiuntivi.php inside your module itself.
Or use the following foolproof method to load the file. This would even work when you call it from a theme.
Say you want to use custom_module_name.campi_aggiuntivi.inc located in your custom module, from a theme then you can use module_load_include
For example,
module_load_include('inc', 'custom_module_name', 'custom_module_name.campi_aggiuntivi');
the above call would load custom_module_name.campi_aggiuntivi.inc from custom_module_name module folder. This way you don't have to hard code the path required to access the file.
Based on your update.. it sounds like you are now trying to create a block programmatically. There are example modules that you can download on Drupal.org. There is a block module in that download.

ADDON or SHARED_ADDON Path in PyroCMS

Im writing a module for PyroCMS,
I need to get the directory of my module that has been installed so I can load an image on the browser.
The image is stored beneath the libraries folder in my module.
I would like to do something like
$logo = $this->get_addon_path(). '/libraries/myfile.png';
Which should return either of these values
www.mysite.com/addons/mysite/modules/mymodule/libraries/myfile.png
www.mysite.com/shared_addons/modules/mymodule/libraries/myfile.png
I managed to find this solution in the code of another program
Id thought id share it.
$this->module_details['path']
For me I just needed to wrap it up like so
base_url() . $this->module_details['path'].'/libraries/gateways/'.$image_name;
Which returns
www.mysite.com/addons/mysite/modules/mymodule/libraries/gateways/myfile.png

In PyroCMS access values defined in language file of a particular module in metadata file

I currently towards the end of the project but stuck at one thing. I have user module and in that there is language file called as user_lan, For some requirement I need to access the value defined in that file from metadata.html of themes/partial/ folder.
Any suggestion.
Thank you.
If that lang file is already loaded then you can access it with:
{{ helper:lang line="foo:bar" }}
http://docs.pyrocms.com/2.1/manual/plugins/helper

Resources