Skip to Content
It is currently February 27th, 2021, 5:22 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: November 8th, 2020, 7:33 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
anyone getting back to me?


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 4:39 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
Interesting.

Yeah, that statement does not look like it should work.

Code:

    
require_once('classes/class.song.php');
    
$song Song::getSong($songID);
    if (!
$song) {
        throw new 
Exception('Song ID must be valid');
    }

    
$selectAlbumIds $db->select()
                        ->
from(['s' => 'songlist'], ['total' => new Zend_Db_Expr('COUNT(*)')])
                        ->
joinRight(['r' => 'requestlist'], 's.ID = r.songID')
                        ->
where('r.status = ?''new')
                        ->
where('s.albumid = ?'$songRequest->albumid);
    
$stmt $db->query($selectAlbumIds);
    
$albumrequested = ($stmt->fetchObject($selectAlbumIds)->total 0);
    
    
$selectQueue $db->query('SELECT COUNT(*) count FROM queuelist')->fetchObject();
    
$disableQueue = ($selectQueue->count 5); 


This is how the section should actually look like.
Note the extra $stmt line and changing $db->fetchObject to $stmt->fetchObject

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 5:41 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
so if i put that line of code in that file it should work?


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 5:48 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
Just replace the corresponding part in your file. I changed 2 lines from what was there in the file I uploaded somewhere in the middle of that snippet. The rest of the snippet is just included here so it's easier to find what part you should replace.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 7:16 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
ok what file sorry?


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 7:21 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
We never switched files. All your problems are in samPHPweb/code/code.request.php

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 7:30 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
thats what i get when i press request
Code:
Fatal error: Uncaught Error: Class 'Song' not found in C:\Program Files\mysamfolder\songreq.net\jaytest\code\code.request.php:19 Stack trace: #0 C:\Program Files\mysamfolder\songreq.net\jaytest\web\request.php(8): require_once() #1 {main} thrown in C:\Program Files\mysamfolder\songreq.net\jaytest\code\code.request.php on line 19


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 8:24 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
That means you made a mistake copy pasting.
Check that your code after copy-pasting contains exactly that snippet in lines 19-34

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 8:27 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
just checked and it does


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 8:59 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
But your error says it can't find the class Song on line 19. Line 19 in the new code is the require_once line and the first use of Song is on line 20.
Did you maybe forget to upload the files after replacing the code locally?

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 10:35 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
yea probably
but the new script i got dont have _playlist
or anything like that


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 10:40 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
Anything starting with an underscore is from the HTML templates and has nothing to do with the PHP templates.

Maybe start over with the files from your Program Files folder and apply both the update (overwrite, do not delete the old files first) from the PHP7 thread as well as the attachment and the snippet from here.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 10:51 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
ok now i'm getting this error

Code:
Warning: require_once(../config/config.php): failed to open stream: No such file or directory in C:\Program Files\mysam\songreq.net\laura\playing.php on line 5

Fatal error: require_once(): Failed opening required '../config/config.php' (include_path='.;C:\php\pear') in C:\Program Files\mysam\songreq.net\laura\playing.php on line 5


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 11:08 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
Now your code is completely messed up.

You have managed to get a playing.php in your "root" folder, but it's supposed to be in /web
Code:
/samPHPweb
/samPHPweb/code
...
/samPHPweb/code/code.request.php
...
/samPHPweb/code/classes
/samPHPweb/code/classes/class.song.php
/samPHPweb/config
/samPHPweb/display
/samPHPweb/library
/samPHPweb/web
...
/samPHPweb/web/playing.php
...
/samPHPweb/index.html
/samPHPweb/index.php


That's the general structure how it should look like (only listed those files that had errors for you so far).
The new error says the playing.php isn't in the web subfolder but at the samPHPweb or whatever your root folder is called level alongside index.php
I have to ask: What version of SAM is installed on your computer / what is the version of the samPHPweb files in the Program Files folder of SAM?
Anything before 4.7 I think has a completely different structure and I got no idea if it's even possible to update that to make it PHP7 compatible.

---

No idea how that happened, but I'll pack a new zip file with all the files (except the config stuff) from my machine that works fine in PHP7.
I think that's the best way forward from here.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2020, 11:18 am 
Offline
Junior User
Junior User

Joined: October 30th, 2020, 9:31 pm
Posts: 25
ok thanks i'm running sam 4.2.2 with php7.3


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group