Solved: 3 Months, 1 Week ago banner postbit specific user
#1
Solved: 3 Months, 1 Week ago
I wanted to know whether it is possible to add a userbanner to a specific user. This userbanner must redirect to a specific post. To add this userbanner in the postbit
Reply
#2
Solved: 3 Months, 1 Week ago
if you want do this only for one user then easy way to do this without any plugin and free is add element with specific id for banner in your postbit
that you want :
<div id="YOURID_{$post['uid']}"><img src="{$mybb->settings['bburl']}/images/mybanner.gif"></div>

and with css do something like this : (for example if your HTML element is div)
div[id^="YOURID_"]{display:none;}
this hide element for all users and when you add below line for specific user only dispalyed for him
div[id^="YOURID_14"]{display:flex !important;}
you can change display to anything but do not forgot to use !important ,because this override this attribute value for that user (in example user with UID 14)
Reply
#3
Solved: 3 Months, 1 Week ago
I can change this from

<div id="YOURID_{$post['uid']}"><img src="{$mybb->settings['bburl']}/images/mybanner.gif"></div>


to


<div id="YOURID_{$post['uid']}"><a href="LINK POST"><img src="{$mybb->settings['bburl']}/images/mybanner.gif"></a></div>

I ask to be sure I make no mistakes Smile
Reply
#4
Solved: 3 Months, 1 Week ago
of course you can add any child to div,also I wrote "YOURID" as sample you can change it to any ID in element and css style (only in element and css must be same)
Reply
#5
Solved: 3 Months, 1 Week ago
I have tried but the banner is inserted in the postbit to all users. I tried doing it with my ID.

<div id="1_{$post['uid']}"><img src="{$mybb->settings['bburl']}/images/mybanner.gif"></div>

CSS:

div[id^="1_1"]{display:flex !important;}

is this wrong?
Reply
#6
Solved: 3 Months, 1 Week ago
you element ID is wrong remember about element ID :
they cannot start with a digit, two hyphens, or a hyphen followed by a digit
when I said YOURID this not mean like user ID this must be a digit , you can set something like "spbanner_" or "cbanner_"
Reply
#7
Solved: 3 Months, 1 Week ago
@Selleck I would approach the problem completely differently. Since only one user should receive this banner, I would provide him/her with the link to the graphic and he/she can then use it in his/her signature
 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)