Jump to content

How to separate videos uploaded on different satellites


Recommended Posts

Is it possible to add  filter videos by satellite in next update?

Let's say I have Main Site A and Satellite B , I would like to filter videos uploaded from Satellite B and in the process give administrators access only to videos uploaded from satellite sites. 

Or Show videos from Satellite B in Satellite B admin also so admin from satellite B can add , delete or changes videos only owned by him, Videos from all satellites will show on Main site too .

 

 

 

 

Link to comment
Share on other sites

This is possible to do now without any changes in KVS. Please go to Website UI -> Pages section of satellite admin panel and search for video_edit block. Inside video_edit block settings activate set_custom_flag1 option and set it to 1 for example. This will mean that all videos uploaded from this satellite will have af_custom1=1 in database.

Then go to Categorization -> Flags and create a new flag for videos with external ID = uploaded_from_satellite and enable its Use this flag as administrator's flag for content option.

Then you need to add the following line into /admin/include/cron_custom.php to automatically assign all videos with af_custom1=1 to have this admin flag (find add custom code here marker to put this code to):

require_once 'functions_base.php';
sql_update("update ktvs_videos set admin_flag_id=coalesce((select flag_id from ktvs_flags where external_id='uploaded_from_satellite'), 0) where af_custom1=1");

This will mean that all videos uploaded from satellite will be auto-assigned admin flag that you've created with (uploaded_from_satellite).

Finally go to Administration -> Administrators and update your admin user to have access only to videos marked with this admin flag (uploaded_from_satellite). This will force this admin user to only have access to videos that were initially uploaded from the satellite.

If you need this for multiple satellites, you can repeat the same steps, but create another admin flag and in video_edit block settings set another value for set_custom_flag1 option (e.g. 2 instead of 1); and change the above code a little bit to use "where af_custom1=2" and change uploaded_from_satellite with another flag ID.

Link to comment
Share on other sites

It worked except for the automatic creation of the flag from videos uploaded from satellite.

Do I have to use exactly   "External id = uploaded_from_satellite"?  I used uploaded_from_filmporno so i know from which satellite it was uploaded.

 

 

Link to comment
Share on other sites

On 4/27/2021 at 5:30 PM, phseven said:

Do I have to use exactly   "External id = uploaded_from_satellite"?  I used uploaded_from_filmporno so i know from which satellite it was uploaded.

You can use whatever external ID you want, but you should then also change accordingly in the SQL query:

sql_update("update ktvs_videos set admin_flag_id=coalesce((select flag_id from ktvs_flags where external_id='uploaded_from_satellite'), 0) where af_custom1=1");

 

 

On 4/27/2021 at 5:36 PM, phseven said:

If i add flag manually when cron runs it removes the flag , so probably some error on the custom code?

It could be possible if you didn't update 'uploaded_from_satellite' in the query correctly to match the external ID of the flag you've created.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...