Support Forum

Modding question

AT Alex T
Alex T
Member

Would I be able to add the icon in the picture below right where it is?  I changed the way the avatars show to the user who created the post, though that gets rid of when someone posts something new.  Would it be possible to do what I want in this screen shot?  

28 Answers

New Answer

MP Mr Papa
Mr Papa
Member

what do you want to add???  the +1 image?  just the image?

if so yes..  just add another column in your forum view template…

AT Alex T
Alex T
Member

Mr Papa said
what do you want to add???  the +1 image?  just the image?

if so yes..  just add another column in your forum view template…

I want that image to show up there any time someone posts a new message in that thread. 

MP Mr Papa
Mr Papa
Member

that is what we did in the icon that you replaced with the avatar…

my comment still holds, add another column for that icon… you will have to check the unreads your self for displaying similar to what our template tag did… $spThisForum->unreads will give you the number of unread posts…

AT Alex T
Alex T
Member

Mr Papa said
that is what we did in the icon that you replaced with the avatar…

my comment still holds, add another column for that icon… you will have to check the unreads your self for displaying similar to what our template tag did… $spThisForum->unreads will give you the number of unread posts…

The problem is that I really don’t know how to do that.  I can follow directions well, but not a coder.  

MP Mr Papa
Mr Papa
Member

in your forum view template file,  you will see something like this:

                                sp_ColumnStart('tagClass=spColumnSection spLeft&width=48%&height=50px');

that starts the column for the topic name…  so just add a new column after that:

                                sp_ColumnStart('tagClass=spColumnSection spLeft&width=6%&height=50px');
                                    if ($spThisForum->unreads > 0) sp_AddIcon('tagClass=spRowIcon spRight&icon=xxxx');
                                sp_ColumnEnd();

where xxxx is the name of the image file you want to display… it will need to be located in your sp theme images folder… 

I havent actually tested this but should get you close…

AT Alex T
Alex T
Member

I tried to figure this out but there’s many areas that start with this?

Do I place that somewhere inside of this:

# Column 1 of the forum row
# ———————————————————————-
sp_ColumnStart(‘tagClass=spIconColumnSection spLeft&width=5%&height=0px’);
sp_SubForumIndexIcon(‘tagClass=spRowIcon spLeft’);
sp_ColumnEnd();
sp_InsertBreak(‘tagClass=groupBreak’);

# Column 2 of the forum row
# ———————————————————————-
sp_ColumnStart(‘tagClass=spColumnSection spLeft&width=49%&height=0px’);
sp_SubForumIndexName(‘tagClass=spRowName’, __sp(‘Browse topics in %NAME%’));
sp_InsertBreak(‘direction=left’);
sp_SubForumIndexDescription(‘tagClass=spRowDescription’);
sp_SubForumIndexPageLinks(‘tagClass=spInRowPageLinks spLeft’, __sp(‘Jump to page %PAGE% of topics’));
sp_ColumnEnd();
sp_InsertBreak(‘tagClass=groupBreak’);

# Column 3 of the forum row
# ———————————————————————-
sp_ColumnStart(‘tagClass=spColumnSection spLeft&width=39%&height=0px’);
sp_SubForumIndexTopicCount(‘tagClass=spInRowCount spLeft’, __sp(‘Topics:’));
sp_SubForumIndexPostCount(‘tagClass=spInRowCount spLeft’, ‘  ’.__sp(‘Posts:’));
sp_InsertBreak(‘direction=left’);
sp_SubForumIndexLastPost(‘tagClass=spInRowPostLink&order=UTLD&nicedate=0&date=1&time=1&stackdate=0&itemBreak= – ‘, __sp(‘Last Post’), __sp(‘No Topics’));
sp_ColumnEnd();
sp_InsertBreak(‘tagClass=groupBreak’);

MP Mr Papa
Mr Papa
Member

no, thats subforums… you want after forums…  after this

                                # Column 2 of the topic row
                                # ----------------------------------------------------------------------
                                sp_ColumnStart('tagClass=spColumnSection spLeft&width=48%&height=50px');
                                    sp_TopicIndexName('tagClass=spRowName', __sp('Browse the thread %NAME%'));
                                    if (function_exists('sp_TopicDescription')) sp_TopicDescription();
                                    sp_TopicIndexPostPageLinks('tagClass=spInRowPageLinks spLeft', __sp('Jump to page %PAGE% of posts'));
                                    if (function_exists('sp_TopicIndexTagsList')) sp_TopicIndexTagsList('tagClass=spTopicTagsList spButton spLeft', __sp('Tags'), __sp('Show the tags for this topic'));
                                    if (function_exists('sp_TopicIndexTopicStatus')) sp_TopicIndexTopicStatus('tagClass=spTopicIndexStatus spButton spLeft', __sp('Search for other topics with this status'));
                                sp_ColumnEnd();

around line 163…  in that section, you will need to make sure all the column width dont exceed 100%…  the above has a width of 68%..  you should see 5 columns…

AT Alex T
Alex T
Member

Is this for Reboot?  Mine looks different?

# Column 2 of the topic row
# ———————————————————————-
sp_ColumnStart(‘tagId=spColForum2&tagClass=spColumnSection spLeft&width=0&height=0px’);
sp_TopicIndexName(‘tagClass=spRowName’, __sp(‘Browse the thread %NAME%’));
if (function_exists(‘sp_TopicDescription’)) sp_TopicDescription();
sp_TopicIndexFirstPost(‘iconClass=spIcon spLeft&icon=sp_ArrowRightSmall.png&nicedate=0&date=1&time=1&stackdate=0&stackuser=0&stackdate=0&itemBreak= – ‘, __sp(‘Started By’));
sp_InsertBreak();
if (function_exists(‘sp_TopicIndexTagsList’)) sp_TopicIndexTagsList(‘tagClass=spTopicTagsList spLeft&delimiter=|&delimiterClass=spTagsDelimiterForum&collapse=0&iconClass=spIcon’, __sp(”), __sp(‘Show the tags for this topic’));
if (function_exists(‘sp_TopicIndexRating’)) sp_TopicIndexRating(‘tagClass=spStatusIcon&spRight&skipZero=1’);
sp_ColumnEnd();

sp_InsertBreak(‘tagClass=groupBreak’);

Here’s how I added the code, however it didn’t work.  I put the image in the main Reboot image folder, not in the pack folder.

# Column 2 of the topic row
# ———————————————————————-
sp_ColumnStart(‘tagId=spColForum2&tagClass=spColumnSection spLeft&width=0&height=0px’);
sp_TopicIndexName(‘tagClass=spRowName’, __sp(‘Browse the thread %NAME%’));
if (function_exists(‘sp_TopicDescription’)) sp_TopicDescription();
sp_TopicIndexFirstPost(‘iconClass=spIcon spLeft&icon=sp_ArrowRightSmall.png&nicedate=0&date=1&time=1&stackdate=0&stackuser=0&stackdate=0&itemBreak= – ‘, __sp(‘Started By’));
sp_InsertBreak();
if (function_exists(‘sp_TopicIndexTagsList’)) sp_TopicIndexTagsList(‘tagClass=spTopicTagsList spLeft&delimiter=|&delimiterClass=spTagsDelimiterForum&collapse=0&iconClass=spIcon’, __sp(”), __sp(‘Show the tags for this topic’));
if (function_exists(‘sp_TopicIndexRating’)) sp_TopicIndexRating(‘tagClass=spStatusIcon&spRight&skipZero=1’);
sp_ColumnEnd();
sp_ColumnStart(‘tagClass=spColumnSection spLeft&width=0%&height=50px’);
if ($spThisForum->unreads > 0) sp_AddIcon(‘tagClass=spRowIcon spRight&icon=sp_Unread.png’);
sp_ColumnEnd();
sp_InsertBreak(‘tagClass=groupBreak’);

 

IK Ike
Ike
Member

In Reboot the column widths work differently to allow the columns to use different widths for different mobile / tablet viewport sizes:

The column’s in the template have the tagId=spColForumX,

The #Id in the stylesheet references a variable in the overlay:

div#spColForumX { width: <?php echo($ColForum_X[0]); ?>; }

So being as the widths are controlled through the overlay, in whatever overlay you are using – see the variable $ColForum_1[0], $ColForum_2[0] etc.. where [0] is with no media rule applied i.e desktop.

As you can see, all the widths add up to 97%, so if you want to make a new one, copy one of the blocks and rename all to $ColForum_5[0], $ColForum_5[800], $ColForum_5[720] etc..

Then you will want to reduce one of the other columns to make some space, and give $ColForum_5[0], a width.

As Steve said – don’t exceed 100%, and try and keep it below 99% if possible.

AT Alex T
Alex T
Member

Ike said
In Reboot the column widths work differently to allow the columns to use different widths for different mobile / tablet viewport sizes:

The column’s in the template have the tagId=spColForumX,

The #Id in the stylesheet references a variable in the overlay:

<br />
div#spColForumX { width: ; }
<br />

So being as the widths are controlled through the overlay, in whatever overlay you are using – see the variable $ColForum_1[0], $ColForum_2[0] etc.. where [0] is with no media rule applied i.e desktop.

As you can see, all the widths add up to 97%, so if you want to make a new one, copy one of the blocks and rename all to $ColForum_5[0], $ColForum_5[800], $ColForum_5[720] etc..

Then you will want to reduce one of the other columns to make some space, and give $ColForum_5[0], a width.

As Steve said – don’t exceed 100%, and try and keep it below 99% if possible.

WHOA!  Sorry, you lost me here.  

IK Ike
Ike
Member

Let me try and word it differently!

OK – The column widths are controlled in the overlay.

Open your overlay file and search for ‘$ColForum_1’. You should see the initial variable

$ColForum_1 = array();

And then underneath you will see the column variables within that array –

$ColForum_1[0]        = '5%';
$ColForum_1[800]    = '6%';
$ColForum_1[720]    = '7%';
$ColForum_1[600]    = '0%';
$ColForum_1[480]    = '0%';
$ColForum_1[360]    = '0%';

$ColForum_2[0]        = '50%';
$ColForum_2[800]    = '47%';
$ColForum_2[720]    = '47%';
$ColForum_2[600]    = '48%';
$ColForum_2[480]    = '48%';
$ColForum_2[360]    = '48%';

$ColForum_3[0]        = '39%';
$ColForum_3[800]    = '46%';
$ColForum_3[720]    = '44%';
$ColForum_3[600]    = '48%';
$ColForum_3[480]    = '48%';
$ColForum_3[360]    = '48%';

$ColForum_4[0]        = '3%';
$ColForum_4[800]    = '3%';
$ColForum_4[720]    = '3%';
$ColForum_4[500]    = '5%';
$ColForum_4[480]    = '0%';
$ColForum_4[360]    = '0%';

In each of these blocks, focus on the first entry $ColForum_x[0] where [0] relates to desktop. These all relate to the 4 columns in your template and is where the column width is controlled.

To add a new column, you would need to add a $ColForum_5[0] and specify a width in the same way as all the others.

But – Remember the widths as I said in my last post. The overall forum row is 100% wide, there are also two 1px separator’s in a forum row. This is why when you add up the widths of all the columns (i.e 5%, 50%, 39% and 3%) it reaches 97% to allow for the 1px separators and a small amount of breathing room.

Maybe try reducing column 2 to 45%, and make your new column 5% wide. That way, you are not changing the overall size. You might need to tweak the sizes once you have your new column set up and working.

So, you would then need to add your new column in the same way as you have done above, but adding the tagId=spColForum5. See:

sp_ColumnStart('tagId=spColForum5&tagClass=spColumnSection spLeft&width=0&height=0px');
    if ($spThisForum->unreads > 0) sp_AddIcon(‘tagClass=spRowIcon spRight&icon=sp_Unread.png’);
sp_ColumnEnd();

This doesn’t need to be done in order so you can insert it before spColForum4, or before spColForum3 if you like.

AT Alex T
Alex T
Member

So i’m gathering that I need to do this first in the overlay:

 

# FORUM VIEW ========================

$ColForum_1 = array();
$ColForum_2 = array();
$ColForum_3 = array();
$ColForum_4 = array();

$ColForum_1[0] = ‘5%’;
$ColForum_1[800] = ‘6%’;
$ColForum_1[720] = ‘7%’;
$ColForum_1[600] = ‘0%’;
$ColForum_1[480] = ‘0%’;
$ColForum_1[360] = ‘0%’;

$ColForum_2[0] = ‘45%’;
$ColForum_2[800] = ‘47%’;
$ColForum_2[720] = ‘47%’;
$ColForum_2[600] = ‘48%’;
$ColForum_2[480] = ‘48%’;
$ColForum_2[360] = ‘48%’;

$ColForum_3[0] = ‘39%’;
$ColForum_3[800] = ‘46%’;
$ColForum_3[720] = ‘44%’;
$ColForum_3[600] = ‘48%’;
$ColForum_3[480] = ‘48%’;
$ColForum_3[360] = ‘48%’;

$ColForum_4[0] = ‘3%’;
$ColForum_4[800] = ‘3%’;
$ColForum_4[720] = ‘3%’;
$ColForum_4[500] = ‘5%’;
$ColForum_4[480] = ‘0%’;
$ColForum_4[360] = ‘0%’;

$ColForum_5[0] = ‘5%’;

Then I go into the forumview and add this:

# Column 2 of the topic row
# ———————————————————————-
sp_ColumnStart(‘tagId=spColForum2&tagClass=spColumnSection spLeft&width=0&height=0px’);
sp_TopicIndexName(‘tagClass=spRowName’, __sp(‘Browse the thread %NAME%’));
if (function_exists(‘sp_TopicDescription’)) sp_TopicDescription();
sp_TopicIndexFirstPost(‘iconClass=spIcon spLeft&icon=sp_ArrowRightSmall.png&nicedate=0&date=1&time=1&stackdate=0&stackuser=0&stackdate=0&itemBreak= – ‘, __sp(‘Started By’));
sp_InsertBreak();
if (function_exists(‘sp_TopicIndexTagsList’)) sp_TopicIndexTagsList(‘tagClass=spTopicTagsList spLeft&delimiter=|&delimiterClass=spTagsDelimiterForum&collapse=0&iconClass=spIcon’, __sp(”), __sp(‘Show the tags for this topic’));
if (function_exists(‘sp_TopicIndexRating’)) sp_TopicIndexRating(‘tagClass=spStatusIcon&spRight&skipZero=1’);
sp_ColumnEnd();

sp_ColumnStart(‘tagId=spColForum5&tagClass=spColumnSection spLeft&width=0&height=0px’);     if ($spThisForum>unreads > 0) sp_AddIcon(‘tagClass=spRowIcon spRight&icon=sp_Unread.png’); sp_ColumnEnd();

sp_InsertBreak(‘tagClass=groupBreak’);

# Column 3 of the forum row
# ———————————————————————-