The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

RPG Roleplay

4 posters

Go down

Solved RPG Roleplay

Post by Simone Boi March 12th 2024, 10:52 pm

Hi! Sorry to bother you but i changed from ModernBB to AwesomeBB, can i ask you again for your support please?

I want to use the method posted by Razor in this topic:

https://help.forumotion.com/t163176-pet-roleplay-table

it doesn't work on AswesomeBB

Thank you a lot!


Last edited by Simone Boi on March 20th 2024, 2:03 am; edited 1 time in total
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by skouliki March 13th 2024, 7:50 am

hello

i will tag @Razor12345 to look into it but keep in mind if you have changed the version to your forum probably all CSS codes and javascript will stop working cause each version has different elements
skouliki
skouliki
Manager
Manager

Female Posts : 15247
Reputation : 1700
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Razor12345 likes this post

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 13th 2024, 3:05 pm

Hi skouliki!
Yes i know! I changed other scripts and css, but i can't figure out how to make @Razor12345 's solution works
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Razor12345 March 14th 2024, 9:04 am

I'll be able to do it next week

P.S. please specify how you modify fields in RPG profile - via AP or via the "Modify" button directly in the profile.
If through the Modify button - I found a bug there, because of which the picture is deleted when modifying the profile.


RPG Roleplay  Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1527
Reputation : 264
Language : Ukr, Rus, Eng
Location : Ukraine

Simone Boi likes this post

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 14th 2024, 11:39 am

Hi Razor!
I wanna modify all by AP, users should not be able to change the Pic or others fields by profile, like you did for my last request on ModernBB

Thank you again!
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 17th 2024, 8:27 am

UP!
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 17th 2024, 9:30 pm

Ok, i tried a lot and removed the button edit on profile, my last problem is that i can't make the image show up on post profile, i think it depends from this scrip:

Code:

          <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>

I tried changing ".postprofile" with ".post-aside" with no success, just a "null" text
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 18th 2024, 8:12 pm

UP! I'm trying but still can't get it works
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Tamichi March 19th 2024, 12:39 am

try with:

'.post-avatar-rph' or '.post-header'
Tamichi
Tamichi
New Member

Posts : 1
Reputation : 1
Language : Napoletan

Back to top Go down

Solved Re: RPG Roleplay

Post by Razor12345 March 19th 2024, 10:34 am

To remove the ability to change a character's avatar:

1) AP - Display - Templates - Profile - rpg_sheet_edit

Find:

Code:
 <form action="{U_ADMIN_RPG}" method="post" name="post">
           
          <div class="block">
                <div class="block-header">
                    {L_AVATAR_PANEL}
                </div>

Replace by this:

Code:
<form action="{U_ADMIN_RPG}" method="post" name="post">
           
          <div class="block__rpg_image">
                <div class="block-header">
                    {L_AVATAR_PANEL}
                </div>

Find:

Code:
 <p style="text-align: center;">{POSTER_RANK}<br />{RPG_IMAGE}</p>

Replace by this:

Code:
<p style="text-align: center;">{POSTER_RANK}<br /><div class='rpg_image'>{RPG_IMAGE}</div></p>

Save. Publish.

2) AP - Display - Colors&CSS - CSS Stylesheet

Insert code:

Code:
.block__rpg_image {
  display: none;
}

.rpg_image {
  text-align: center;
}

Submit.

Result:

RPG Roleplay  Scree775

RPG Roleplay  Scree776

Upload a character image to the user's profile:

Only for PC:

1) AP - Display - Templates - General - viewtopic_body

Find:

Code:
{postrow.displayed.POSTER_RPG}

Before this code, insert this:

Code:
<div class='character__container'>
                                                  <div class='character__title'>Pet:</div>
                                                  <div class='character__image'></div>
                                          </div>

At the end of template, insert this code:

Code:
    <script>
    window.addEventListener('DOMContentLoaded', function() {
      const users = document.querySelectorAll('.post-body');
      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.rpg-view p 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:

Code:
.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:

RPG Roleplay  Scree777


RPG Roleplay  Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1527
Reputation : 264
Language : Ukr, Rus, Eng
Location : Ukraine

Simone Boi likes this post

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 19th 2024, 1:25 pm

Hi Razor! Thanks for replay, I tried but It doesn't work for me, i didn't edit a lot in templates, and i even tried with not JavaScript activated

RPG Roleplay  Img-2012

RPG Roleplay  Img-2013

Viewtopic_body:

RPG Roleplay  Img-2014

RPG Roleplay  Img-2015



I can't understand what im doing wrong
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Razor12345 March 19th 2024, 1:40 pm

Forum address?


RPG Roleplay  Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1527
Reputation : 264
Language : Ukr, Rus, Eng
Location : Ukraine

Simone Boi likes this post

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 19th 2024, 1:50 pm

avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Razor12345 March 19th 2024, 2:17 pm

In this code:

Code:
    <script>
    window.addEventListener('DOMContentLoaded', function() {
      const users = document.querySelectorAll('.post-body');
      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.rpg-view p img');
            item.querySelector('.character__container .character__image').append(findElement);
            },
            error: function (xhr, status, error) {
              console.log("AJAX request error:" + error);
            },
          });
        }
    });
  });
 
  </script>

Try replace DOMContentLoaded with load:

Code:
    <script>
    window.addEventListener('load', function() {
      const users = document.querySelectorAll('.post-body');
      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.rpg-view p img');
            item.querySelector('.character__container .character__image').append(findElement);
            },
            error: function (xhr, status, error) {
              console.log("AJAX request error:" + error);
            },
          });
        }
    });
  });
 
  </script>


RPG Roleplay  Screen51
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1527
Reputation : 264
Language : Ukr, Rus, Eng
Location : Ukraine

TonnyKamper, poesia-verses and Simone Boi like this post

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 19th 2024, 2:39 pm

Hi Razor!

RPG Roleplay  Img-2016

Still the same, It doesn't show up
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by Simone Boi March 19th 2024, 7:43 pm

Razor, i tried again, maybe i had a problem on the other pc, but now it works!

https://imgur.com/reN1TqJ

Thank you man! I owe you a pizza!

I just have a little problem with text but i'll figure out how to solve
avatar
Simone Boi
Forumember

Posts : 92
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Solved Re: RPG Roleplay

Post by skouliki March 20th 2024, 2:33 pm

Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!
Please read our forum rules: ESF General Rules

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 15247
Reputation : 1700
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum