Forum Activity for @tig

TiG
@tig
01/13/22 02:13:29PM
184 posts

Invoking View function from another View handler


Jamroom Developers

I have a need to create a new comment as part of the functionality of a menu item handler. So, essentially, this is a view handler that needs to 'invoke' another view handler.

Logically, I want to use the comment_save functionality to create the new comment so as to reuse the official mechanics for creating a new comment (similarly for deleting a comment). Ideally I would call a jrComment_create_comment() function but this does not exist. The only encapsulation of create mechanics is in the view function.

What approach would be best to create a new comment from another view function?
updated by @tig: 04/14/22 09:57:44AM
TiG
@tig
12/04/21 03:06:48PM
184 posts

Hook for server-based final validation of new comment


Jamroom Developers

Excellent because that is how I implemented this. Nice, clean server-based implementation.

Thanks Brian, TiG
TiG
@tig
12/02/21 02:06:21PM
184 posts

Hook for server-based final validation of new comment


Jamroom Developers

Looks like a 'run_view_function' listener can do the trick. Would you folks agree that this is the right way to go?
updated by @tig: 12/02/21 02:35:10PM
TiG
@tig
12/02/21 12:07:53PM
184 posts

Hook for server-based final validation of new comment


Jamroom Developers

We have a need to validate a new comment before it is saved to the database. We want to gain access to the final form of the comment content, validate and if error, leave the user in the editor with an error message and thus the means to take corrective action.

The key is to have the validation done at the server (not on the client with Javascript). Ideally this validation would be activated by an event in view_jrComment_comment_save() that would allow us to perform the validation and then fail the transaction with an error message when appropriate.

Stated differently, the jrPostComment() Javascript function executes when a new comment is ready to be posted. This function issues an AJAX transaction which triggers view_jrComment_comment_save(). We would like to insert validation that looks and behaves like an error message issued by the view_jrComment_comment_save() function.

Aside:
The update portion of this problem is solved by a 'form_validate_init' listener. The create portion of the problem remains unsolved. We have a Javascript solution for the create portion but that is not ideal for security reasons and it is redundant code.
updated by @tig: 03/05/22 05:55:38AM
TiG
@tig
08/10/21 08:05:18PM
184 posts

Purging Obsolete Media Files


Jamroom Developers

Michael

That is what I figured. We might do a quick trim of a few old, huge files just to give us some breathing space while I develop an automated solution to more gracefully manage obsolete wasted storage.

Thanks again,
TiG
TiG
@tig
08/10/21 04:33:01PM
184 posts

Purging Obsolete Media Files


Jamroom Developers

Michael:

There are a number of massive files (via FileZilla) that we know we can delete to free up space. These are video files. I must ask if it is possible to literally delete the files. What is the effect on the balance of Jamroom if a video file is deleted? My test shows that the embed command in a comment for a deleted video simply returns a null string (which is perfect).;

Do you see any downside to us going directly to known obsolete media files and simply deleting them from the file system and not taking any other action?

Thanks,
TiG
updated by @tig: 08/10/21 05:37:02PM
TiG
@tig
08/09/21 07:18:24PM
184 posts

Purging Obsolete Media Files


Jamroom Developers

Michael

My prior analysis led me to the media functions (among others). Your response has raised my confidence that these are the functions I should be using.

It does seem that there are quite a few combinations of media file names. I see variations like:
 src="http://thenewstalkerscom.jamroomhosting.com/data/media/0/0/Ning_Media/discussions/0/101_discussions.jpg" 
and
src="http://thenewstalkers.com/upimg/image/upimg_file/4852/256" 

That is why I was crossing my fingers that there was a 'magical' function that could resolve the variations into a single file reference that could be passed to:
jrCore_delete_media_file($profile_id, $file)
or
jrCore_delete_item_media_file
or
jrCore_confirm_media_file_is_local
.

Given your lead, I will use the media module as my epicenter and see what I can discover from there.

Thanks again for your insight,
TiG
updated by @tig: 08/09/21 07:18:51PM
TiG
@tig
08/08/21 06:29:15PM
184 posts

Purging Obsolete Media Files


Jamroom Developers

We have a need to purge obsolete space-consuming media files. Our plan is to identify comments (and articles) that are no longer considered 'timely' and remove all image, video, etc. files associated with those comments (and articles). The embedded
img src="..."
, ... HTML will then be removed from the comment (or article).

In result, these obsolete comments (and articles) will be stripped of their associated HTML media references and the stored media files will be purged to free up disk space.

Key question is which JR functions should be used support this algorithm? How, for example, can we best translate the
img src
information into a reference to the stored media file and then, given that reference, what is the best JR function to use to delete just that file?

Thanks.
updated by @tig: 11/09/21 11:34:47PM
TiG
@tig
12/15/20 08:20:35PM
184 posts

Block and unBlock of a User


Jamroom Developers

Michael

I greatly appreciate that! Now I have an elegant and safe solution.

Thanks for this. TiG
  2