- Joined
- Jun 17, 2022
- Messages
- 256
- Awards
- 3
Offline
I spotted a request on here from @blackestflag and thought I'd do some digging to figure it out myself... Then thought instead of just posting the php file or instructions on what to copy/paste... Why not make a little video documenting how I figured it out and what tools I use to help rev-eng (so maybe someone here can learn too). For context I have next to no experience with php so anyone can do this.
This will show you how to change the posters from movies to series, how to remove info from the details bar (in this case, duration/runtime).
Screenshots loaded from browser in PC by going to 'yourhost.xyz/smarterspanel/api/autoads.php' . They appear differently in your app depending how its set up. Obviously replace yourhost.xyz/smarterspanel with your own domain/folder.
Movies - before edits
Series - with added overview/descripton
I don't show moving the ratings bar etc around but I mention where the lines are to change position etc.
What you need:
- A text editor (if you don't already have Notepad++, get it)
- Common sense
Tools I use for investigating:
- Notepad++ and its compare plugin. It's find/replace functions (Ctrl+F, it can find in files/folders to search any file for words).
- WinMerge - if I have 2 panels, they're built from the same source but have different features, I can use WinMerge to compare and single out differences. (didn't use it here but worth a mention).
To change from movies to series, find & replace (without quotes):
"/movie/" with "/tv/"
"/movie?" with "/tv?"
"data.release_date" with "data.first_air_date"
"data.title" with "data.name"
Vice versa to change back. If changing to series, you need to hide the runtime/duration info from the "subtitial-info" bar, it's not relevant to series.
Lines 241-254 in autoads.php:
To remove duration, delete " + ` | ` + ' ' + hours + ' ' + minutes" from line 248 (shown as 8 here). Then comment out the duration, hours and minutes definitions (lines 245/6/7 or 5/6/7 here) by adding "// " before them, so it should look like this:
To unhide/hide overview/description, just underneath the last snippet of code you'll see:
Uncomment this line to show them (delete the "// "
To move ratings etc around/change sizes, its all configured in lines 278-389. You'll have to tinker with positions/sizes, do some trial and error until you get it right for the app you've got.
Here's video of how I figured it out:
This will show you how to change the posters from movies to series, how to remove info from the details bar (in this case, duration/runtime).
Screenshots loaded from browser in PC by going to 'yourhost.xyz/smarterspanel/api/autoads.php' . They appear differently in your app depending how its set up. Obviously replace yourhost.xyz/smarterspanel with your own domain/folder.
Movies - before edits
Series - with added overview/descripton
I don't show moving the ratings bar etc around but I mention where the lines are to change position etc.
What you need:
- A text editor (if you don't already have Notepad++, get it)
- Common sense
Tools I use for investigating:
- Notepad++ and its compare plugin. It's find/replace functions (Ctrl+F, it can find in files/folders to search any file for words).
- WinMerge - if I have 2 panels, they're built from the same source but have different features, I can use WinMerge to compare and single out differences. (didn't use it here but worth a mention).
To change from movies to series, find & replace (without quotes):
"/movie/" with "/tv/"
"/movie?" with "/tv?"
"data.release_date" with "data.first_air_date"
"data.title" with "data.name"
Vice versa to change back. If changing to series, you need to hide the runtime/duration info from the "subtitial-info" bar, it's not relevant to series.
Lines 241-254 in autoads.php:
PHP:
// Update movie subtitial
const releaseDate_full = data.first_air_date;
const genresArray = data.genres.map(genre => `🎬 ${genre.name}`).join(' ');
const origin_country = data.production_companies.map(production_companies => `${production_companies.origin_country}`).join(' ');
const duration = data.runtime;
const hours = Math.floor(duration / 60) + 'h';
const minutes = duration % 60 + 'm';
const fullSubtitial = ` 📀 ` + releaseDate_full + ` (${origin_country}) ` + ` | ` + genresArray + ` | ` + '🕝 ' + hours + ' ' + minutes;
mcategory.innerText = fullSubtitial;
const mrating = data.vote_average;
rtxratingbar.setAttribute("value", mrating);
To remove duration, delete " + ` | ` + ' ' + hours + ' ' + minutes" from line 248 (shown as 8 here). Then comment out the duration, hours and minutes definitions (lines 245/6/7 or 5/6/7 here) by adding "// " before them, so it should look like this:
PHP:
// const duration = data.runtime;
// const hours = Math.floor(duration / 60) + 'h';
// const minutes = duration % 60 + 'm';
const fullSubtitial = ` 📀 ` + releaseDate_full + ` (${origin_country}) ` + ` | ` + genresArray;
To unhide/hide overview/description, just underneath the last snippet of code you'll see:
PHP:
// movieOverview.innerText = data.overview;
Uncomment this line to show them (delete the "// "
To move ratings etc around/change sizes, its all configured in lines 278-389. You'll have to tinker with positions/sizes, do some trial and error until you get it right for the app you've got.
Here's video of how I figured it out:
Last edited: