Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

Pages: (2) 1 2  ( Go to first unread post ) ClosedNew TopicNew Poll

 Guest Mini Profile with HTML Templates [SOLVED]
#
Good Evening Everyone,

I am currently using the new HTML Templates section in the ACP to design a mini profile for my board and have found that I cannot use the script which previously allowed for the implementation of multiple mini profiles - AKA a mini profile for the guests and for registered members. Since this is a new means of creating the mini profile, I was wondering if there was a new code I should use? I have included a variation of the code which I am referring to below.

I would appreciate any help. Thank you in advanced!

CODE
<script>if (parseInt(<!-- |g_id| --!>)) {document.write(the HTML for the mini-profile);}else { document.write(the HTML for the guest mini-profiles);}</script>


This post has been edited by BRITTNEY: Sep 9 2016, 06:49 PM
PM
#
<!-- |g_id| --!> should be <!-- |g_id| -->

You put two ! points.

signature
email: admin@jcink.com :: blog: John C.
#
I tried using the same code with the adjusted <!-- |g_id| --> and it made all of my mini profiles disappear. I am not sure why it is doing that instead of differentiating the mini profiles.
PM
#
Can you link me? I want to check and see what's happening myself.

signature
email: admin@jcink.com :: blog: John C.
#
You can see an example of what I am talking about here. The first post is supposed to be from the root admin, the second from a member, and the third from a guest. It appears that all three disappear when the code is implemented.

EDIT: As a side note, the <!-- |last_topic| --> within Forum Rows is described as "the last post title with a link", but it does not link to the post. Instead it simply produces the name so an additional code has to be used to make it clickable.

This post has been edited by BRITTNEY: Sep 12 2016, 06:17 PM
PM
#
There are more syntax errors in the javascript:

CODE
SyntaxError: expected expression, got '<'index.php:2836:33
SyntaxError: expected expression, got '<'


I dont know where you got the script above but pasting the html directly in the document.write() without any quotes around it will not work and will just produce errors. I think this is why you are having trouble.

Please paste your mini profile template and I will fix it http://files.b1.jcink.com/html/emoticons/smile.gif

Regarding your note about <!-- |last_topic| --> -- this problem is not reproducible for me on either here or my test board. A link is shown every time I use it. It is working fine as intended. But, we will work on this issue after the MP is fixed, however.

signature
email: admin@jcink.com :: blog: John C.
#
I think this may be the problem as well! Thank you so much for taking the time to fix it. I have included the code below:

CODE
<script>if (parseInt(<!-- |g_id| -->)) {document.write(<div id="mini"><div class="container-<!-- |g_id| -->"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a><br><b>Played By <!-- |field_1| --></b></div></div><div id="container"><div id="background"><div class="title"><!-- |field_8| --></div><br><div class="location"><span class="<!-- |g_title| -->"><!-- |field_9| --></span></div><div class="image" style="background-image:url(<!-- |field_13| -->);"></div><div class="ability"><marquee direction="left" onmouseover="this.stop()" onmouseout="this.start()" scrollamount="3"><!-- |field_6| --></marquee></div><div class="species"><span class="<!-- |g_title -->"><!-- |g_title| --></span></div><div class="school"><!-- |field_5| --></div><div class="age"><!-- |field_4| --></div><div class="level-<!-- |g_id| -->"><!-- |field_7| --></div><div class="occupation"><!-- |field_10| --></div><div id="avatar"><!-- |avatar| --></div></div></div></div>);}else { document.write(<div id="mini"><div class="container-<!-- |g_id| -->"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a></div></div><div id="container"><div id="background"><div id="avatar"></div></div></div></div>);}</script>


As for the <!-- |last_topic| -->, that's very strange! I cannot get it to work without using a tag to add in the code. Hopefully that is a quick fix as well. (:
PM
#
Just to interject and maybe make things easier, but with the new system, you don't need that script anymore.

User owl wrote this up at my request as a way to display multiple main profiles using just HTML/CSS and it's working just fine for my miniprofiles as well.

All you have to change is 'progroup' to something else like 'miniprogroup' if you are going to use the process for both Main and Mini Profiles.

I just think if you can avoid using a script wherever possible it's less likely for something to bug out or go wrong.
PM
#
Please try this:

CODE
<script>if ('<!-- |g_id| -->' != '3') {document.write('<div id="mini"><div class="container-<!-- |g_id| -->"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a><br><b>Played By <!-- |field_1| --></b></div></div><div id="container"><div id="background"><div class="title"><!-- |field_8| --></div><br><div class="location"><span class="<!-- |g_title| -->"><!-- |field_9| --></span></div><div class="image" style="background-image:url(<!-- |field_13| -->);"></div><div class="ability"><marquee direction="left" onmouseover="this.stop()" onmouseout="this.start()" scrollamount="3"><!-- |field_6| --></marquee></div><div class="species"><span class="<!-- |g_title -->"><!-- |g_title| --></span></div><div class="school"><!-- |field_5| --></div><div class="age"><!-- |field_4| --></div><div class="level-<!-- |g_id| -->"><!-- |field_7| --></div><div class="occupation"><!-- |field_10| --></div><div id="avatar"><!-- |avatar| --></div></div></div></div>');}else { document.write('<div id="mini"><div class="container-<!-- |g_id| -->"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a></div></div><div id="container"><div id="background"><div id="avatar"></div></div></div></div>');}</script>

signature
email: admin@jcink.com :: blog: John C.
#
I had to rearrange the code a little as I put the guest and registered member in backwards, but I was able to get the guest mini profile up and working; however, my registered member mini profile is still not appearing. This is the adjusted code that I am not using:

CODE
<script>if ('<!-- |g_id| -->' != '3') {document.write('<div id="mini"><div class="container"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a></div></div><div id="container"><div id="background"><div id="avatar"></div></div></div></div>');}else { document.write('<div id="mini"><div class="container-<!-- |g_id| -->"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a><br><b>Played By <!-- |field_1| --></b></div></div><div id="container"><div id="background"><div class="title"><!-- |field_8| --></div><br><div class="location"><span class="<!-- |g_title| -->"><!-- |field_9| --></span></div><div class="image" style="background-image:url(<!-- |field_13| -->);"></div><div class="ability"><marquee direction="left" onmouseover="this.stop()" onmouseout="this.start()" scrollamount="3"><!-- |field_6| --></marquee></div><div class="species"><span class="<!-- |g_title -->"><!-- |g_title| --></span></div><div class="school"><!-- |field_5| --></div><div class="age"><!-- |field_4| --></div><div class="level-<!-- |g_id| -->"><!-- |field_7| --></div><div class="occupation"><!-- |field_10| --></div><div id="avatar"><!-- |avatar| --></div></div></div></div>');}</script>
PM
#
As a side note, as I am just now seeing the response from Chlocelot, while this is an excellent means of adding in hiding variables that you wish to remove from certain member groups, it does not work with guests. I think this is due to the fact that the guests group does not directly correlate to their group number, thus assigning the number does nothing. I will definitely keep this in mind for future reference in other areas though!
PM
#
It should be showing ID #2 for guests. Please try now.

#3 is the members group, I really should have done this the other way.

To be clear:

CODE
<script>if ('<!-- |g_id| -->' != '2') { document.write("members"); } else { document.write("guests"); }</script>


Is the conditional that *should* work.

signature
email: admin@jcink.com :: blog: John C.
#
I attempted to use the code that you have provided and that does not appear to work either; the only thing that appears is the guest mini profile if I change "guests" to 'guests'. In addition to this, I am not receiving a syntax error which reads the following:

CODE
index.php:2995 Uncaught SyntaxError: missing ) after argument list
index.php:3057 Uncaught SyntaxError: missing ) after argument list


I apologize for all of the hassle! This is what my mini profile looks like as of now:

CODE
<script>if ('<!-- |g_id| -->' != '2') { document.write('<div id="mini"><div class="container-<!-- |g_id| -->"><div class="name"><a href="/index.php?showuser=<!-- |id| -->"><!-- |author_name| --></a><br><b>Played By <!-- |field_1| --></b></div></div><div id="container"><div id="background"><div class="title"><!-- |field_8| --></div><br><div class="location"><span class="<!-- |g_title| -->"><!-- |field_9| --></span></div><div class="image" style="background-image:url(<!-- |field_13| -->);"></div><div class="ability"><marquee direction="left" onmouseover="this.stop()" onmouseout="this.start()" scrollamount="3"><!-- |field_6| --></marquee></div><div class="species"><span class="<!-- |g_title -->"><!-- |g_title| --></span></div><div class="school"><!-- |field_5| --></div><div class="age"><!-- |field_4| --></div><div class="level-<!-- |g_id| -->"><!-- |field_7| --></div><div class="occupation"><!-- |field_10| --></div><div id="avatar"><!-- |avatar| --></div></div></div></div>'); } else { document.write('<div id="mini"><div class="container"><div class="name"><!-- |author_name| --></div></div><div id="container"><div id="background"><div id="avatar"></div></div></div></div>'); }</script>


This post has been edited by BRITTNEY: Sep 12 2016, 04:33 PM
PM
#
QUOTE (BRITTNEY @ Sep 12 2016, 12:17 PM)
As a side note, as I  am just now seeing the response from Chlocelot, while this is an excellent means of adding in hiding variables that you wish to remove from certain member groups, it does not work with guests. I think this is due to the fact that the guests group does not directly correlate to their group number, thus assigning the number does nothing. I  will definitely keep this in mind for future reference in other areas though!


Well if you end up scrapping the Javascript solution and attempting the tutorial I wrote up, please do let me (you should be able to tag me in the thread) know if you're having issues with guests, specifically, as it should be working for guests as well - it does on my site, which uses this method.

signature
#
After spending a little time closely evaluating the code which owl has supplied, I found that this works perfectly for what I am trying to accomplish! Thank you all so much for your time and assistance. I sincerely appreciate it.
PM
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

OptionsPages: (2) 1 2  ClosedNew TopicNew Poll