Forum Activity for @brian

brian
@brian
06/17/23 07:25:55AM
10,148 posts

update stream count by 1 seem impossible


Jamroom Developers

OK thanks for attaching the module. So there's a couple things in the view I'll go over:

jrCore_validate_location_url();

You don't want this at the top of your view function UNLESS the view is being called by an XHR/Ajax request that has had the URL prepared with jrCore_set_csrf_cookie(). Your JS functions are not using that function so you do not want that at the top of your view function.

Here is your view function working for me:

/**
 * @param $_post
 * @param $_user
 * @param $_conf
 * @return bool|void
 */
function view_jrShoutcastPlayer_update($_post, $_user, $_conf)
{ if (!isset($_post['song']) || strlen($_post['song']) == 0) { return jrCore_json_response(array('error' => 'invalid song title')); } if (!isset($_post['profile_name'])) { return jrCore_json_response(array('error' => 'invalid profile name')); } // Get all audio files that are part of this album $_sp = array( 'search' => array( "audio_title = {$_post['song']}", "profile_name = {$_post['profile_name']}", "audio_artist = {$_post['profile_name']}" // "_item_id = 3" - use by brian for testing ), 'return_item_id_only' => true, 'exclude_jrUser_keys' => true, 'exclude_jrProfile_quota_keys' => true, 'order_by' => false, 'limit' => 1 ); $_rt = jrCore_db_search_items('jrAudio', $_sp); if (isset($_rt) && is_array($_rt)) { jrCore_db_increment_key('jrAudio', reset($_rt), 'audio_file_stream_count', 1, true); return jrCore_json_response(array('success' => 1)); } return jrCore_json_response(array('error' => 'update failed')); }

Note a couple changes I made:

'return_item_id_only'          => true,

In your case you are only interested in the _item_id - by using the "return_item_id_only" $_rt will just be a simple array with the matching ID if found - i.e.

0 => 3

This is much more efficient since it saves a second query that gets the actual keys for the item.

I also set "order_by" to FALSE - there's no reason to request an order when you're getting one result.

Attached is the update - let me know how that works for you.
jrShoutcastPlayer.zip - 841KB

updated by @brian: 06/17/23 07:26:24AM
brian
@brian
06/17/23 07:07:06AM
10,148 posts

ACP Problems


Using Jamroom

Yeah these are still errors from your server - not Jamroom:

[Tue Jun 13 19:24:35.539474 2023] [core:crit] [pid 8279:tid 47110593132288] (13)Permission denied: [client 185.191.171.12:37722] AH00529: /home/dubmusic/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/dubmusic/public_html/' is executable    

Here's someone on Stack Overflow having the same issue:

https://stackoverflow.com/questions/20627084/permission-denied-var-www-abc-htaccess-pcfg-openfile-unable-to-check-htacces

Who is your hosting provider? This is a pretty simple issue they should have already fixed for you.

Let me know if that helps.
brian
@brian
06/16/23 09:09:11AM
10,148 posts

ACP Problems


Using Jamroom

I need to know what the error is from your error log. If it is a permission problem then it is a hosting problem - not a Jamroom problem and your hosting provider is incorrect.
brian
@brian
06/15/23 08:19:05AM
10,148 posts

SSO Jamroom integration with Ghost


Jamroom Developers

You can turn off signups by unchecking in the ACP -> Users -> Users -> Global Config -> "User Signups".

For the second it sounds like you just kind of want everything to be "read only" - does that sound right? Or do you want them to not be visible at all?
brian
@brian
06/15/23 08:08:12AM
10,148 posts

Files


Using Jamroom

Isleander:
Are files that are uploaded to a Jamroom site accessible via the server? i.e. Is there a particular folder on the server that can be access by the site owner?

Yeah - if you have FTP/SFTP access to your server, you will find all the media files are stored in the data/media directory. Within data/media there are first "profile group" directories (basically grouped by the thousand) and then inside each group directory you will find the actual media directories for the individual profiles. The files have fairly readable names -i.e. "jrTicket_25_ticket_file.jpg" so you should have no problem seeing what they are.

Let me know if that helps.
brian
@brian
06/15/23 08:04:47AM
10,148 posts

update stream count by 1 seem impossible


Jamroom Developers

Hi Jacob - looks like you just have a small typo - change this:

jrCore_db_increment_key('jrAudio',$_rt['_items'][0]['item_id'], 'audio_file_stream_count',1,true);

To this:
jrCore_db_increment_key('jrAudio',$_rt['_items'][0]['_item_id'], 'audio_file_stream_count',1,true);

note the addition of the underscore to "item_id" so it becomes "_item_id" - the item ID is an internal key so always starts with an underscore.

Let me know if that works for you.

Thanks!
brian
@brian
06/11/23 08:33:47PM
10,148 posts

Jamroom 7 Beta Kickoff


Announcements

RickStaRr:
I noticed that your error codes has two // following public html. Not sure if that is the reason. I encountered a slew of errors on php 8.1 so I went back to 7.4 until the devs have completed writing the jr code for php 8 markup.

At this time 7.4 should be rock solid - there's still a lot of 3rd party code and less popular modules we are still going through to make sure they are PHP 8.+ ready.
brian
@brian
06/11/23 08:32:33PM
10,148 posts

Jamroom 7 Beta Kickoff


Announcements

I do all my dev on PHP 8.2 so that error in the marketplace module should have been caught - I will get that fixed up. Unfortunately PHP 8+ really changes a lot of the fundamentals in PHP which has required us to update thousands of lines to handle the new stricter type checking.
brian
@brian
06/11/23 08:30:48PM
10,148 posts

How to add or edit Blog Categories?


Using Jamroom

pch:
Now what about how to edit an existing category name?

Just modify the blog entry and change the category name to what you want it to be.

Quote:
Also, can blog categories be translated, in case of multilingual website?

You would have to do something custom there - blog categories are not part of the JR language system.
brian
@brian
06/11/23 08:39:33AM
10,148 posts

Jamroom 7 Beta Kickoff


Announcements

Quote: 'Unable to process your request
he system has encountered an unrecoverable error - please try again shortly'

Check in your data/logs directory for the error_log - the error will be at the bottom of the file.
  9