how can I get the real address from file path like this '@@pulgin....'
I try the function file rewrite plugin file urls..it does not work
Please explain the context a little more:
- Is this in your own plugin, or are you messing around with text from another plugin?
- You say the function 'file rewrite plugin file urls' does not work - I assume you mean 'file_rewrite_pluginfile_urls', this function has been used successfully as part of Moodle core for several years now, so I suspect it is the way you are trying to use it which is wrong, not the function itself.
- Please give an example of some text with 'https://moodle.org/pluginfile.php/178/mod_forum/post/1126637/' within it which you are trying to use, with the parameters you have passed to 'file_rewrite_pluginfile_urls' and the result you are getting out of this (also with any error messages, or an explanation of what is not working).
second as the topic yes it is my own plugin.Iam indeed want to say the function file_rewrite_pluginfile_urls because I see in the assign/submission/onlinettext the view function use $this->assignment->render_editor_content() show summary part ,well in the render_editor_content() will use the function to get file path so I think when I include the lib.php It may be work ,but it can not show the image.
then would you please guide me with the contextid and the file storage way the moodle use.
finally looking forword you reply its to hard to learn without someone help and It hard to get the information i want in this site can you tell me some site that will help me with learning moodle programming?
If this is the 'intro' text for your activity module, then use the function format_module_intro and that will take care of it for you.
If this is a different field, then you need to use the same params you used when you called file_postupdate_standard_editor to save the files in the first place - namely:
- component = the frankenstyle name of your plugin (e.g. mod_forum)
- contextid = the ID of the context for your plugin (e.g. $context = context_module::instance($cmid) )
- filearea = whatever name you want to give the file area
- itemid (if used) = whatever id number is relevant to the particular file area you are using (it is your choice as to what to use this number for)
thank for you reply
as for the second way user submit the image in the assign mod well I want to show in another mod so how can get the params .as if I only use function in my mod dose that mean I can define a constant instand of component,contextid,filearea?
what the relatation between the corsemodule and context(or contextid)?
what about itemid?
my best wishes