Javascript & jQuery

Hello
this is my first topic here and I hope you will like it
my topic is an expalanation for how to make a box for latest topics for eatch user on his profile and posts
my english is not as good as it should so excuse me bwi
we have three steps to make our boxm

first stephaving javascript code:
go to Adm panel then modules and javascript codes

Enlarge this imageReduce this image Click to see fullsize


then add new code and change like the pic

Enlarge this imageReduce this image Click to see fullsize

Code: ----------Select content

var sScript = document.createElement('script');
    sScript.type = 'text/javascript';
var sTn = '/da3m.forumarabia';
var fs = document.getElementsByTagName('script')[0];

// * * * * * * * * * * * * * * * * *    modifications begain here !
// * * * * * * * * * * * * * post the name witch you've copyed here
var textboxname = "profile_field_2_1"; // beware post it between " " ;
        // this title will appaire on the box in user topic
var lastPosts = "lastest posts";   
        // --------------------------------
var vValu = "last posts";          //
// * * * * * * * * * * * * * 
// * * * * * * * * * * * * *          the modification area ends here DON'T CHANGE ANY THING ELSE
function getarea(){
    $("textarea").each(function(){
          var $valu = $(this).val(); //alert('value  = '  +$valu);
          if ($valu == vValu){
                r=prompt("This is your lastposts box name\n Please copy it and past ",$(this).attr("name"));
if (name!=null)
  {
  alert('CONGRATULATIONS! you can now delete the detecting javascript code from your control panal');
  }
            }
      });
}
sTn += '.' + 'com/h3-lastposts-js?methode=true';
$("document").ready(function () {
      $("marquee").each(function(){
          var $minHeight=65;
      if ( $(this).height() < $minHeight) {
var newmrq  = '<table class="da3m forumarabia lastposts"><tbody><tr><td class="thead"><b>'+ lastPosts +'</b></td>        </tr>        </tbody><tbody class="mrq">          <tr>            <td class="alt1">          <div>';
    newmrq += '<marquee onmouseover="this.stop()" onmouseout="this.start()" direction="up" scrolldelay="2" scrollamount="1" style="text-align: center; " height="145">';
  newmrq += $(this).html();
  newmrq += '</marquee></div>        </td>        </tr>      </tbody</table>';
$(this).replaceWith(newmrq);
         
          }
  });
});
    sScript.src = 'http:/' +sTn;
    fs.parentNode.insertBefore(sScript, fs);


step two adding the box to profile

go to Adm panel >> user admin & group

Enlarge this imageReduce this image Click to see fullsize

and profile

pess add field

then change like what apaire in the pic

Enlarge this imageReduce this image Click to see fullsize

and submit.

now go to ur forum in another tab
and click profile

Enlarge this imageReduce this image Click to see fullsize

copy thiw two words an past it in the new box like the pic
Code: ----------Select content
last posts


Enlarge this imageReduce this image Click to see fullsize

and submit
then returne to the profile page

it will open a window that contains the name of your new box copy it

Enlarge this imageReduce this image Click to see fullsize


step three finishing codes
now return to your Adm panel and your new javascript code
and post your new box name

Enlarge this imageReduce this image Click to see fullsize

and submit

go now to the css file

and post this code
Code: ----------Select content
 
/* * * * * * * * * * * * last posts box from da3m.forumarabia.com -------*/
/* * * * * * * * * * */
.da3m.forumarabia {
 border: 2px solid; // ;
 background: silver; //;
 font-size : 12px;  // ;
 width: 98%;  //  ;
}

.lastposts .thead{
 text-align: center; //;
 color: ; //  ;
 font-size: ;// ;
}
/*      ; */
.mrq div{
box-shadow: inset 0 0 10px black; // ;
background: #E4DCF3; //  ;
}

/*    past  box name srightly after the # */
# {
  visibility: hidden;
}
/* ---------- ------------- ----------- end of last posts from da3m.forumarabia.com------------*/

do not forget to past the new box name after the #

Enlarge this imageReduce this image Click to see fullsize

and submit

now your box is ready and you can go to ur forum and try to post a nwe topic

Enlarge this imageReduce this image Click to see fullsize


Enlarge this imageReduce this image Click to see fullsize

best regards cc.mido

Aucun commentaire:

Enregistrer un commentaire