The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Starred forums

View previous topic View next topic Go down

Starred forums

Post by fascicularia on December 26th 2016, 5:53 pm

Technical Details


Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Opera
Screenshot of problem : https://i37.servimg.com/u/f37/11/93/85/24/pour_f10.png
Who the problem concerns : All members
Forum link : http://altitudetropicale.forums-actifs.com

Description of problem

Hello everyone ,
I have an issue with a tutorial to Ange Tuteur.
http://fmdesign.forumotion.com/t501-starred-forums

The js works partially: the selection is well taken into account but the text and the formatting of the forum is not taken into account.

My index_box
Code:
<div id="infogeneral">
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<span class="statmembre"> {CURRENT_TIME}<br /> </span>
<!-- END switch_user_logged_in -->
<span class="nav nav-clean"> <a class="nav" href="{U_INDEX}">Index des forums</a>{NAV_CAT_DESC}</span>
</td>
<td class="gensmall" align="right" valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<input class="burger-check" id="burger-check" type="checkbox"/>
<label for="burger-check" class="burger"></label>
<nav id="navigation1" class="navigation">
<div class="bu"><ul>
<li> <a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a>  </li>
<li> <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a> </li>
<!-- END switch_user_logged_in -->
<li><a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> </li>
<li><a class="gensmall" href="/feed/" target="_blank">S'abonner au flux RSS du forum</a> </li>
<li><a class="gensmall" href="/profile?mode=sendpassword" target="_blank">Récupérer un nouveau mot de passe</a>
</li>
</ul>
</div>
</nav>
</td>
</tr>
</table>
</div>
                 
<!-- BEGIN catrow -->
<!-- BEGIN tablehead -->
<table class="M14_forumline"width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle">
{catrow.tablehead.L_FORUM} </th>
</tr>
    <!-- END tablehead -->
            <!-- BEGIN cathead -->
            <tr>
            <td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">
            <h{catrow.cathead.LEVEL} class="hierarchy">
            <span class="cattitle">
            <a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>
            </span>
            </h{catrow.cathead.LEVEL}>
            </td>
            <td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>
            </tr>
            <!-- END cathead -->
            <!-- BEGIN forumrow -->
            <tr>
            <!-- BEGIN inc -->
            <td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>
            <!-- END inc -->
         
             
              <td class="" align="center" valign="middle">
            <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
            </td>
             
            <td class="" colspan="1" valign="top" width="100%" height="50"style="vertical-align:middle"><div class="categ"><table width="100%"><tr><td><h{catrow.forumrow.LEVEL} class="hierarchy">
                        <span class="forumlink">
                          <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}"><div class="beautitre"><span class="gradualfader">{catrow.forumrow.FORUM_NAME}</span></div></a>
                        </span>
                    </h{catrow.forumrow.LEVEL}></td></tr></table>

            <!-- ENCADREMENT DES CATEGORIES-->
            <div class="haut_cate"> </div> <div class="milieu_cate"style="width: 100% ! important;">
            <!-- FIN ENCADREMENT DES CATEGORIES-->
         

            <table>
            <tr>
            <td width="100%">

              <span class="genmed"><div style="text-align:justify;"> <div class="cato">
               
                {catrow.forumrow.FORUM_DESC}</div></div></span>
                 
                  </td>
         
                  <td><td align="center" valign="middle" height="50">
<div class="cata"> <!-- BEGIN avatar -->
            <div style="width: 200px;"></div>
 
 
  <div class="M14_last-avatar_noel"style="float: left;margin-right: -26px;position: relative;top: -1px;">
<img src="https://cdn4.iconfinder.com/data/icons/silent_night_icons/128/santacornerhat.png" style="width:30px;"/>
</div>
 
            <span class="lastpost-avatar">{catrow.forumrow.avatar.LAST_POST_AVATAR}</span>
                    <!-- END avatar -->
<span class="gensmall"> <div class="stats"> {catrow.forumrow.TOPICS}sujets<br />{catrow.forumrow.POSTS} messages</div> </span> </div>



            <div class="catb"><span class="gensmall last-post">{catrow.forumrow.LAST_POST}</span>
                        <!-- BEGIN switch_topic_title -->
                      <div class="lasts">  <a  href="{catrow.forumrow.U_LATEST_TOPIC_POST}"  title="{catrow.forumrow.LATEST_TOPIC_TITLE}"></a></div>
                        <!-- END switch_topic_title -->
    </div>
                    </td></td>
              </tr>
              </table>
         
         
            <!-- SUITE EN CADREMENT CATEGORIE -->
              </div>
            <div class="bas_cate"> </div>
            <!-- FIN SUITE EN CADREMENT CATEGORIE -->
            </div>

            <table width="100%"><tr><td><div class="linf">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
            </div>  </td></tr></table></td></tr>

            <!-- END forumrow -->
            <!-- BEGIN catfoot -->
            <tr>
            <!-- BEGIN inc -->
            <td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
            <!-- END inc -->
            <td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
            </tr>
            <!-- END catfoot -->
            <!-- BEGIN tablefoot -->

    </table>
            <img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot -->
    <!-- END catrow -->   
 
The Js
Code:
$(function() {
          'DEVELOPED BY ANGE TUTEUR';
          'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
          'ORIGIN : http://fmdesign.forumotion.com/t501-starred-forums#6825';
       
          // automatically detects the version
          var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : 'badapple';
       
          // error notifications
          if (version == 'badapple' || !window.JSON || !window.localStorage) {
            var errString = 'The plugin "fa_starred" could not be executed because : ';
       
            if (version == 'badapple') errString += '\nYour forum version is not supported.';
            if (!window.JSON) errString += '\nJSON is not supported by your browser';
            if (!window.localStorage) errString += '\nThe Storage API is not support by your browser.';
       
            window.console && console.error ? console.error(errString) : alert(errString);
            return;
          }
       
          // get fontawesome if unavailable
          if (!$('link[href$="font-awesome.min.css"]')[0]) {
            document.getElementsByTagName('HEAD')[0].insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css" />');
          }
       
          window.fa_starred = {
            version : version, // forum version
            forums : localStorage.fa_starred_forums ? JSON.parse(localStorage.fa_starred_forums) : null,
       
            // language settings
lang :
{
star : 'Mettre ce forum en favoris',
unstar : 'Supprimer ce forum des favoris',
            starred : '<center style="cursor:pointer;"title="Cette partie regroupe tous vos forums favoris">Forums favoris</center>'
},
       
 icon : {
star :'<img src="https://i37.servimg.com/u/f37/11/93/85/24/sans_t22.png"/>',
unstar :'<img src="https://i37.servimg.com/u/f37/11/93/85/24/sans_t23.png"/>'
            },
       
            // selectors
            select : {
content : version ? document.getElementById('main-content') : $('#content-container td:has(> img[height="5"])')[0],
category : ['.M14_forumline:has(.secondarytitle)', '.forabg', '.main:has(.tcr) .main-content', '.borderwrap:has(.index-box)'][version],
forum : 'a.' + (version ? 'forumtitle' : 'forumlink'),
              row : version == 1 ? 'li' : 'tr'
            },
       
            // move the selected forum to the "starred" category
            star : function(that, id, startup) {
              if (!fa_starred.forums) fa_starred.forums = {};
              if (!fa_starred.board) fa_starred.createStarBoard();
       
              if (!fa_starred.forums[id]) {
                // clone the row and add it to the star board
                var clone = $(that).closest(fa_starred.select.row)[0].cloneNode(true),
                    rows = $(that).closest(fa_starred.select.row).parent().find(fa_starred.select.row);
       
                // update the star attributes for the clone
                $('.fa_star', clone).attr({
                  'onclick' : 'fa_starred.unstar(this, ' + id + '); return false',
                  'class' : 'fa_unstar',
                  'title' : fa_starred.lang.unstar
                }).html('<i class="fa">' + fa_starred.icon.unstar + '</i>');
       
                fa_starred.list.appendChild(clone); // append the clone to the starred category
       
                $(that).closest(fa_starred.select.row)[0].style.display = 'none'; // hide the original row
       
                // check if all forums are hidden for this category
                for (var i = 0, j = rows.length, k = 0; i < j; i++) {
                  if (/none/.test(rows[i].style.display)) k++;
                }
       
                // hide the category if all forums are hidden
                if (i == k) {
                  $(that).closest(fa_starred.select.category)[0].className += ' fa_star_hidden';
                }
       
                // jump to the star board if it's out of sight
                if (!startup && document.getElementById('fa_star_board').getBoundingClientRect().top < 0) {
                  window.location.hash = '';
                  window.location.hash = '#fa_star_board';
                }
       
                // update storage
                fa_starred.forums[id] = 1;
                localStorage.fa_starred_forums = JSON.stringify(fa_starred.forums);
              }
       
            },
       
            // unstar the selected forum
            unstar : function (that, id) {
              var forum, catg, i = 0, j;
       
              fa_starred.list.removeChild($(that).closest(fa_starred.select.row)[0]); // remove cloned row
       
              // update variables
              forum = $(fa_starred.select.forum + '[href^="/f' + id + '-"]')[0]; // original forum
              catg = $(forum).closest(fa_starred.select.category)[0]; // original category
       
              $(forum).closest(fa_starred.select.row)[0].style.display = ''; // show the original forum's row
       
              // show the category if all forums were hidden
              if (/fa_star_hidden/.test(catg.className)) {
                catg.className = catg.className.replace(/fa_star_hidden/, '');
              }
       
              // delete the starred forum and check if there are anymore stars
              delete fa_starred.forums[id];
              for (j in fa_starred.forums) {
                if (fa_starred.forums[j]) i++;
              }
       
              // update storage
              if (i) {
                localStorage.fa_starred_forums = JSON.stringify(fa_starred.forums);
              } else {
                fa_starred.forums = null;
                localStorage.removeItem('fa_starred_forums');
       
                // remove nodes
                if (version == 2) {
                  fa_starred.board.parentNode.removeChild(fa_starred.board.previousSibling); // remove header for punbb
                }
                fa_starred.board.parentNode.removeChild(fa_starred.board);
       
                // delete node references
                delete fa_starred.board;
                delete fa_starred.list;
              }
       
            },
       
            // create the "starred" category
            createStarBoard : function() {
              var catg = $(fa_starred.select.category, fa_starred.select.content)[0],
                  board = catg.cloneNode(true),
                  rows = $(fa_starred.select.row, board);
       
              board.id = 'fa_star_board';
              board.style.display = '';
       
              if (version != 2) {
                board.getElementsByTagName('H2')[0].innerHTML = fa_starred.lang.starred; // change category title
              }
       
              // find forum list and remove exisiting rows in the clone
              fa_starred.list = rows[0].parentNode;
              rows.remove();
       
              // punbb insertion method
              if (version == 2) {
                var head = catg.previousSibling.cloneNode(true);
                head.getElementsByTagName('H2')[0].innerHTML = fa_starred.lang.starred;
       
                catg.parentNode.insertBefore(board, catg.previousSibling);
                board.parentNode.insertBefore(head, board);
              } else {
                catg.parentNode.insertBefore(board, catg); // default insertion
              }
       
              fa_starred.board = board;
            }
          };
       
          fa_starred.select.row += ':has(' + fa_starred.select.forum + ')'; // update row selector
       
          // general startup
          var a = $(fa_starred.select.forum, fa_starred.select.content),
              i = 0,
              j = a.length,
              k,
              id;
       
          // setup star board and reset forum states if starred
          if (fa_starred.forums) {
            if (!fa_starred.board) fa_starred.createStarBoard();
            for (k in fa_starred.forums) {
              fa_starred.forums[k] = 0;
            }
          }
       
          // setup stars and starred forums
          for (; i < j; i++) {
            id = a[i].href.replace(/.*?\/f(\d+).*/, '$1');
       
            a[i].insertAdjacentHTML('afterend', '<a href="#" class="fa_star" onclick="fa_starred.star(this, ' + id + '); return false;" title="' + fa_starred.lang.star + '"><i class="fa">' + fa_starred.icon.unstar + '</i></a>');
       
            if (fa_starred.forums) {
              for (k in fa_starred.forums) {
                if (k == id) {
                  fa_starred.star(a[i], id, true);
                }
              }
            }
          }
       
          document.getElementsByTagName('HEAD')[0].insertAdjacentHTML('beforeend', '<style type="text/css">a.fa_star,a.fa_unstar{margin-left: 10px;padding:3px;position: absolute;border-radius: 50px;opacity:0}a.fa_star:hover,a.fa_unstar,li:hover a.fa_star,tr:hover a.fa_star{opacity:1}a.fa_star i,a.fa_unstar i{position:relative}a.fa_star i:hover:after,a.fa_unstar i:after{content:"' + fa_starred.icon.star + '";position:absolute;left:0;bottom:0}a.fa_unstar i:hover:after{content:""}.fa_star_hidden {display:none!important}</style>');
        });

Thank you in advance to those who will help me.

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by SLGray on December 26th 2016, 10:15 pm

Have you removed the tutorial? I do not see the stars when I hover over the forums' titles.


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


SLGray
Administrator
Administrator

Male Posts : 37705
Reputation : 2533
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Starred forums

Post by skouliki on December 27th 2016, 3:40 pm

hello




skouliki
Graphic Designer
Graphic Designer

Female Posts : 2058
Reputation : 306
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Re: Starred forums

Post by fascicularia on December 27th 2016, 5:21 pm

Hello SLGray, Hello skouliki,
SLGray, the script was disabled on my original forum.
Here is the link of my test forum on which I have just applied the changes.

http://altitudetest.forumactif.com



Skouliki, like any coding, it is possible to adapt the js or find the sequence on which the script acts.

Thank you both for this help and my best wishes for this end of the year.

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by skouliki on December 27th 2016, 5:41 pm

Merry Christmas to you and your family

i really think the best solution is to communicate with Ange to fix this

skouliki
Graphic Designer
Graphic Designer

Female Posts : 2058
Reputation : 306
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Re: Starred forums

Post by fascicularia on December 27th 2016, 8:34 pm

No problem. If it passes on the forum of assistance, no doubt that it will help me.

Thank you for your help.

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 2nd 2017, 2:28 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 5th 2017, 3:22 pm

Bump

please Help me Flowers

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 6th 2017, 2:31 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 7th 2017, 3:08 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 10th 2017, 5:13 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by SLGray on January 10th 2017, 10:00 pm

It could be that the code will not work as your forum is not in English.


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


SLGray
Administrator
Administrator

Male Posts : 37705
Reputation : 2533
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Starred forums

Post by Van-Helsing on January 11th 2017, 12:49 am

Hello,
As @Skouliki marked correctly on the screenshot the plugin will work only on forums without heavily templates modifications, I am seeing that your forum's board index is heavily modified. In this case you have to contact @Ange Tuteur to adapt it for your forum as he is the author of the code.

Van-Helsing
Hyperactive

Male Posts : 2248
Reputation : 85
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Re: Starred forums

Post by fascicularia on January 15th 2017, 5:04 pm

Thank you both for your intervention.
The forum language does not affect how the script works.

If Ange Tuteur comes to pass on the subject, he will certainly help me. I will not bother him on his messenger; I prefer to wait.

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 19th 2017, 4:26 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 20th 2017, 8:38 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 23rd 2017, 8:08 pm

Bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on January 27th 2017, 3:56 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on February 3rd 2017, 1:10 am

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on February 4th 2017, 6:19 pm

Bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on February 7th 2017, 7:24 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on February 12th 2017, 5:47 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on February 15th 2017, 1:31 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by fascicularia on February 17th 2017, 2:34 pm

bump

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

Re: Starred forums

Post by SarkZKalie on February 17th 2017, 6:01 pm

Backup your recent template then try default one.

SarkZKalie
Forumember

Male Posts : 470
Reputation : 78
Language : English

http://rotavn.nstars.org/

Back to top Go down

Re: Starred forums

Post by fascicularia on February 18th 2017, 3:17 pm

Hello SarkZKalie,
Thank you for the advice but I already checked with a template by default and the script works perfectly.
If I come to ask for help on the support forum it is that I have a custom template.
The script works but partially. It is to solve this problem that I appeal to the community.

fascicularia
Forumember

Posts : 163
Reputation : 1
Language : french

Back to top Go down

View previous topic View next topic Back to top


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