PET & Roleplay table
To remove the ability to change a character's avatar:
1) For PC version:
AP - Display - Templates - Profile - rpg_sheet_edit
Find and delete:
Save. Publish.
Result:
https://servimg.com/r/1620204341/scree759.png
2) For mobile version:
AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
Submit
Result:
In this case, only the admin will be able to set and change the image via AP.
-------
Upload a character image to the user's profile:
Only for PC:
1) AP - Display - Templates - Profile - rpg_sheet
Find:
Replace by this:
Save. Publish.
2) AP - Display - Templates - General - viewtopic_body
Find:
Before this code, insert this:
At the end of template, insert this code:
Save. Publish.
3) AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
Submit.
Result:
Ultima modifica di Admin il Mer Mar 13, 2024 2:37 am - modificato 2 volte. (Motivazione : 4)
To remove the ability to change a character's avatar:
1) For PC version:
AP - Display - Templates - Profile - rpg_sheet_edit
Find and delete:
Codice:
<h1 class="page-title">{L_AVATAR_PANEL}</h1>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<fieldset>
<dl>
<dt><label>{L_UPLOAD_AVATAR_URL}</label></dt>
<dd><input type="text" name="avatarurl" value="{AVATAR_URL}" class="inputbox" />
<br /><span class="italic">{L_UPLOAD_EXPLAIN}</span>
</dd>
</dl>
<span style="color:red">{L_AVATAR_ERROR}</span>
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
Save. Publish.
Result:
https://servimg.com/r/1620204341/scree759.png
2) For mobile version:
AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
Codice:
form[action*="rpg_sheet"] div.box:first-of-type {
display: none;
}
Submit
Result:
In this case, only the admin will be able to set and change the image via AP.
-------
Upload a character image to the user's profile:
Only for PC:
1) AP - Display - Templates - Profile - rpg_sheet
Find:
Codice:
<p>{POSTER_RANK} {RPG_IMAGE}</p>
Replace by this:
Codice:
<p>{POSTER_RANK} <div class='rpg_image'>{RPG_IMAGE}</div></p>
Save. Publish.
2) AP - Display - Templates - General - viewtopic_body
Find:
Codice:
{postrow.displayed.POSTER_RPG}
Before this code, insert this:
Codice:
<div class='character__container'>
<div class='character__title'>Pet:</div>
<div class='character__image'></div>
</div>
At the end of template, insert this code:
Codice:
<script>
window.addEventListener('DOMContentLoaded', function() {
const users = document.querySelectorAll('.postprofile');
users.forEach(item => {
const address = item.querySelector('a[href$="rpgsheet"]');
if (address) {
$.ajax({
url: address.href,
method: "GET",
data: 'image',
dataType: "html",
success: function (data) {
let div = document.createElement('div');
div.innerHTML = data;
let findElement = div.querySelector('div.column1 div.rpg_image img');
item.querySelector('.character__container .character__image').append(findElement);
},
error: function (xhr, status, error) {
console.log("AJAX request error:" + error);
},
});
}
});
});
</script>
Save. Publish.
3) AP - Display - Colors&CSS - CSS Stylesheet
Insert this code:
Codice:
.character__container {
display: flex;
justify-content: space-around;
align-items: center;
}
.character__image {
max-width: 100px;
max-height: 100px;
}
.character__image img {
width: 100%;
height: 100%;
}
Submit.
Result:
Ultima modifica di Admin il Mer Mar 13, 2024 2:37 am - modificato 2 volte. (Motivazione : 4)