Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 14, 2010 23:31:00 GMT -8
So I was wondering if anyone would be able to form a code that will take the topics, replies and recent posts into its own placeable <div> tag that can be placed anywhere with the corresponding <div> tag; like for instance in an HTML table that replaces a board. Something kind of like the cloned Info Center Code.
Is this possible at all, to classify all that data into a div id? I'd be grateful to anyone who gives it a try <3 Thanks for your time.
|
|
|
Post by Wormopolis on Jun 14, 2010 23:40:26 GMT -8
have an example of what you forsee it looking like?
|
|
Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 15, 2010 0:13:21 GMT -8
Uhm, Uhm..... Well kind of like in its own box as shown in this screen shot here: ImageI have custom made HTML tables for my site, wrapped in J-script, but I was wondering if that data can be put in a placeable <div> so it shows up where ever that <div> ID is placed in the HTML code. If I knew how to do it myself, I would xD Like I said, I'm a newb :B
|
|
|
Post by Wormopolis on Jun 15, 2010 0:24:39 GMT -8
It can be done.. although the "topics/posts" might seem kinda weird when its next to a thread title instead of a board title...
do you know how to get board ids? The best way to write this would have each DIV with an id like <div id="relocate_general"></div>
then the stuff you want moved from the general board will go in that div. that way you can put the divs in whatever order you desire and boards without last post information, or boards that certain mebers cant access wont have anything show up in their respectiev div (thereby leaving it empty so it doesnt look odd).
you would need a div for each board you wanted to have its stats relocated (boards without divs just wont be moved).
and next question would be would the relocated info just be cloned or removed from its current location?
|
|
Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 15, 2010 0:52:44 GMT -8
I believe the info would be cloned, very similar to the Cloned Info center code, if possible, since the actual proboard boards are HIDDEN, I wouldnt have to worry about hiding the original data, only where the cloned info will be placed. Like in this screen shot, I would like the "topcs/posts" data to be displayed in the box that has "Sub Boards" and "View recent posts" Image
|
|
|
Post by Wormopolis on Jun 15, 2010 12:18:30 GMT -8
wait.. you mean "Hidden" as in you used a code to hide them, or hidden as in you went to board settings and selected the board to be hidden from main page?
|
|
Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 15, 2010 12:26:28 GMT -8
I used the proboards settings in the categories and selected Hide Category "Yes" No codes there.
|
|
|
Post by Wormopolis on Jun 15, 2010 15:18:06 GMT -8
hidden boards that dont display on the main page via category settings cannot have information retrieved from them without server access.
the only way to get information in javascript is if its already been handed to the browser by the server.
|
|
Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 15, 2010 15:33:08 GMT -8
Okay then. Well, thanks anyways. I'll figure something else out.
|
|
|
Post by Wormopolis on Jun 15, 2010 15:34:51 GMT -8
the other route you could take would have a code hide all the boards/categories instead.. but a code can always be bypassed.
|
|
Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 15, 2010 16:34:51 GMT -8
And I have done so. I now have a javascript code that only shows the content I have within the <script> tags, so all the boards and categories are not hidden in the settings, but by the code. Will that work with what I want to do, or is it still not possible?
|
|
|
Post by Wormopolis on Jun 15, 2010 23:53:07 GMT -8
that should be able to fetch now yes.
I should have this done soon...
|
|
|
Post by Wormopolis on Jun 18, 2010 10:13:42 GMT -8
anyways.. you can see on the main page what I have so far. I got all the major parts working if you want it as is. you dont have to display it like I have it however.
Im looking at your original request and still confused as to why you want to relocate the topics/replies numbers to the same place as the last post?
|
|
Cainy-Face
Not New Member
[Sj1:0]
Posts: 20
Cainy-Face said 0 great things
|
Post by Cainy-Face on Jun 18, 2010 16:26:54 GMT -8
I replaced the default proboards boards with HTML wrapped javascript tables. ( my site) as you can clearly see in that link. What I WANT to do, is have a row/div ID that will replace the link that says "View Recent Posts" with the actual data that appears in the topics/posts column in the default boards, like the boards here.
|
|
|
Post by Wormopolis on Jun 19, 2010 2:02:10 GMT -8
ok ok I see where you are going with this then!
this code will still work then because you dont have to have all the relocs in the same place. once they have an id, they can be found anywhere (as long as they appear ABOVE the code).
so in preperation, wherever you want the last post info to appear for that board, make a div: <div id="lpreloc_boardid"></div>
where boardid is the boards id (which you can find by hovering over the board title and seeing what its URL is example, your board "Etched in stone" would need <div id="lpreloc_general"></div>
once you get all those divs in there, put this code in your main footers BELOW the HTML you made (or it wont find it)
<script type="text/javascript"> <!-- // Last Post Relocate v1.0 // By Wormopolis - www.wormocodes.com // do not repost - keep header intact // request by cainey-face
lp_mode=2; // lp_modes: // 1: move all discovered last posts into destination // 2: move only ones that have specific divs setup // 3: both
lp_newmode=true; // lp_newmode: // true: seperate out the last posts that register as "new" when in lp_mode 1 or 3. specific divs in 3 stay normal // false: group all together in order they are found
// if using lp_mode 2 (or 3), specific divs must have id="lpreloc_"+boardid // example board id general would look for div id="lpreloc_general"
nwpstsDivide='<hr width="75%">NEW POSTS<hr width="75%">'; //HTML for divider, can be image if desired oldpstsDivide='<hr width="75%">OLD POSTS<hr width="75%">'; //HTML for divider, can be image if desired
if (pb_action=='home') { lstpstCont='<br>'; nwlstpstCont='<br>'; for (tds=document.getElementsByTagName('td'), s=0; s<tds.length; s++) { if (tds[s].width=='66%' && tds[s].vAlign=='top' && tds[s].className.match(/windowbg/)) { brdlnk=tds[s].getElementsByTagName('a')[0]; brdid=brdlnk.href.split('board=')[1]; lstpstcl=tds[s].nextSibling.nextSibling.nextSibling; nwpstcl=tds[s].previousSibling; nwpstchk=(nwpstcl.firstChild.alt && nwpstcl.firstChild.alt=='[/li][li]'); lstpstStuff=lstpstcl.firstChild.innerHTML.split(/<br>/i); lstpstEntry=lstpstStuff[2].replace(/in /,'')+' '+lstpstStuff[1]+' '+lstpstStuff[0]; if ((lp_mode==2 || lp_mode==3) && document.getElementById('lpreloc_'+brdid)) { document.getElementById('lpreloc_'+brdid).innerHTML=lstpstEntry; } else { if (lp_mode!=2) { if (lp_newmode && nwpstchk && pb_username!='Guest') nwlstpstCont+=lstpstEntry+'<br>'; else lstpstCont+=lstpstEntry+'<br>'; } } } } if (lp_mode != 2) { lstpstCont+='<br>'; nwlstpstCont+='<br>'; if (lp_newmode && pb_username!='Guest') { document.getElementById('lastpostspot').innerHTML=(lstpstCont!='<br><br>' && nwlstpstCont!='<br><br>' ? oldpstsDivide : '') + lstpstCont + (nwlstpstCont!='<br><br>' ? nwpstsDivide : '') + nwlstpstCont; } else { document.getElementById('lastpostspot').innerHTML=lstpstCont; } }
} // --> </script>
we can work on customizing exactly how it looks and/or what shows up in the div. currently it doesnt relocate the post/replies data, but that can be added in.
|
|