RPG Sheets appearance, fields limit, scrollable sheets

Page 1 of 2 1, 2  Next

Go down

In progress RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 19th 2019, 7:01 pm

Hello Everyone,

It's me again, begging again for help ! Today, I saw something on a forum, and loved it very much, I'd like to know if it was possible on forumotion, and if yes, can someone help me with it ?

First of all, I wondered if it was possible to increase the "visible fields" on posts, it's limited to 3 at the moment.

And then, is it possible to have all the sheet, displayed in a scrollable window ? Like here : http://miradelphia.forumpro.fr/t24306-fort-celime-orgueil-et-prejuges-pv-nakor#399792

Thank you very much !
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 19th 2019, 7:28 pm

There is a limit of 3 fields from what I can tell. That forum seems to have a single textarea which contains all of the information. I could make a javascript code that loads the rpg sheets into the topic, but it may be a little slow. I have another thing I'm working on for now, but I can do it if you want.
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 19th 2019, 7:30 pm

I see. I would appreciate it, a very lot, as always I love you ; thank you very much !
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 19th 2019, 8:26 pm

Do you mean profile fields?


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 19th 2019, 8:28 pm

If I understood correctly, they are talking about the rpg fields that show up in the profile in topics.
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 19th 2019, 8:35 pm

@Occultist wrote:If I understood correctly, they are talking about the rpg fields that show up in the profile in topics.

Yes !
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 21st 2019, 1:42 pm

Bump! I love you
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 21st 2019, 1:52 pm

I will work on this in the next couple days. I have a personal project that I need to finish. Keep bumping this topic so I don't forget about it, though.
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 21st 2019, 2:13 pm

Alright, thank you Occultist! And good luck in your project!
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 21st 2019, 9:28 pm

If there is no replies, you can bump this topic every 2 days.


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 23rd 2019, 2:07 pm

Okidoki, bump!
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 23rd 2019, 3:39 pm

First, in your viewtopic_body template, find
Code:
{postrow.displayed.POSTER_RPG}
and replace it with:
Code:
<div class="postprofile-rpg">{postrow.displayed.POSTER_RPG}</div>
Save and publish the template.

Then add this javascript code with placement on topics:
Code:
;var expiration=1000*60*60*24;
window.store={
save:(id, data, expiry)=>{
expiry=store.exp(expiry);
localStorage.setItem(id, JSON.stringify({data:data, expiry:expiry}));
console.log(expiry);
},
exp:(expiry)=>{
return (new Date()).getTime()+expiry;
},
get:(id)=>{
var item=localStorage.getItem(id), expiry;
if(item===null) return false;
item=JSON.parse(item);
if(parseInt(item.expiry)<(new Date()).getTime()){
localStorage.removeItem(id);
return false;
}
return item.data;
},
};

var d=document, parser=new DOMParser(), q=(e)=>{return d.querySelector(e);}, _q=(e)=>{return d.querySelectorAll(e);}, l=(e, ev, f)=>{e.addEventListener(ev, (c)=>f(c));};
var domify=(string)=>{return parser.parseFromString(string, "text/html");};
l(d, 'DOMContentLoaded', function(){
var links=_q(".postprofile-info a[href*='rpgsheet']");
Array.from(links).forEach((e, i)=>{
var url=e.getAttribute("href");
if(store.get(url)!==false){
e.parentElement.innerHTML="<a href='"+url+"'>Rpgsheet</a>"+store.get(url);
} else {
setTimeout(()=>{
fetch(url).then(function(response){
return response.text();
}).then(function(html){
var dom=domify(html), data;
data=dom.querySelector(".panel>.inner").innerHTML;
store.save(url, data, expiration);
e.parentElement.innerHTML="<a href='"+url+"'>Rpgsheet</a>"+data;
});
}, 100*i);
};
});
});
You can edit the very first line. That number there is the number of milliseconds that the rpgsheet data will be cached. By default, it is set to 1 day(1000*60*60*24). You can modify this however you want, or ask me if you need help with it.

I made this code on a default modernbb theme. It may require very small modifications to work on your forum. I haven't worked on styling anything so far, but that shouldn't be too hard. Let me know if it works. Leave the code on your forum even if it doesnt work so I can debug it. Wink
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 23rd 2019, 9:55 pm

Hi !

Thank you, I just did that, you can watch where the problems are, it's pretty easy to find ahahaa !
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 23rd 2019, 11:26 pm

Guests can not see those sections in the profiles in messages.


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 23rd 2019, 11:29 pm

Yes they can : http://continentem.forumactif.com/t559-le-refectoire

You can see the sheets in the left. And if really needed, there is the Guest account : Guest; guest123
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 23rd 2019, 11:34 pm

It does not appear in all profiles.  When I first visited, I only saw the first post which does not have it.

When you added the codes, did you make sure to not add the numbers to the left?


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 23rd 2019, 11:47 pm

Yeah, all the accounts doesn't need sheets, that's why haha !

What do you mean, not adding the numbers to the left ?
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 24th 2019, 12:19 am

Code:
<div class="postprofile-rpg">{postrow.displayed.POSTER_RPG}</div>
Make sure that the 1. is not in your code.


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 24th 2019, 12:20 am

It is not !
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 24th 2019, 12:27 am

What about the JavaScript?


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 24th 2019, 12:34 am

Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 24th 2019, 8:02 pm

The javascript code worked as intended. Now we got to figure out how to make everything look good. Is there anything from the rpgsheet that got loaded in and is not needed?
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 25th 2019, 12:00 am

Nah, it's better if everything is loaded!
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 25th 2019, 12:48 am

So the only issue now is that the rpg fields are not in a scroll box?


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 25th 2019, 12:49 am

Yeah, pretty much
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 25th 2019, 6:43 pm

Add this CSS code to your stylesheet:
Code:
.postprofile-rpg dl, .postprofile-rpg, .postprofile-rpg>div, .postprofile-rpg .column2 dt, .postprofile-rpg .column2 dd{
display:table;
}
.postprofile-rpg .column2{
position:relative;
width:100% !important;
}
.column1{
border:none !important;
}
.postprofile-rpg label{
width:100%;
}
.postprofile-rpg .column2 dl{
width:100%;
}
.postprofile-rpg .column2 dl>*{
position:relative;
margin:0 !important;
}
.postprofile-rpg .column2 dd{
position:relative;
top:8px;
}
.postprofile-rpg{
display:block;
width:100%;
height:200px;
overflow-y:scroll !important;
overflow-x:hidden !important;
}
This will make the rpgsheet scrollable. As you may notice, the images are cut off. That will get fixed as a part of https://help.forumotion.com/t157905p30-little-problems-with-the-rpg-features-barsboards-etc
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 25th 2019, 6:45 pm

Ok it works.

Hum, you mean you will answer for the cut part with the other topic ? Thank you anyway I love you
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Occultist on September 25th 2019, 7:40 pm

Yup, I'll probably work on it tomorrow.
Occultist
Occultist
Forumember

Posts : 181
Reputation : 47
Language : English and couple others

https://idonthaveaforum.forumotion.com

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by Gurufissu on September 26th 2019, 6:23 pm

Oki doki :wouhou:
Gurufissu
Gurufissu
Forumember

Posts : 78
Reputation : 2
Language : French

http://continentem.forumactif.com/

Back to top Go down

In progress Re: RPG Sheets appearance, fields limit, scrollable sheets

Post by SLGray on September 26th 2019, 8:28 pm

If this is solved, please click the green solved button at the top.


RPG Sheets appearance, fields limit, scrollable sheets Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46536
Reputation : 3268
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

Page 1 of 2 1, 2  Next

Back to top


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