LOLWesta, a social media forum


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

1
Need assistance Empty Need assistance Wed Sep 24, 2014 1:14 pm

Test Account


Members
Members
Hey there guys. So I'm currently working at Inbox system, that will replace the current 'You have no new message'. Also I'm currently working with PM Toast that will appears automatically when I receive PM.

Here's my current progress. You can edit it as much as you want. /?/

Code:
$(function() {
var i = 0;
$_get("/privmsg?folder=inbox",)

Now, I stopped writing there. I'm busy with school and such. And I'm currently stuck on coding.

2
Need assistance Empty Re: Need assistance Wed Sep 24, 2014 1:36 pm

LOLWesta


LOLWesta King
I'll help you but I will work for it since I've finished my lang script ok

https://lolwesta.forumotion.com

3
Need assistance Empty Re: Need assistance Fri Sep 26, 2014 7:29 am

sugar


Members
Members
try to work with this tho Smile i give my try ok

Code:
$(function() { var i = 0; $_get("/privmsg?folder=inbox"){.done(function() {console.log("replacing the text.");} } });

you do like that, keep working at the code Smile it's the semi compressed version you can separate them if you want the uncompressed sure

and for pm toast you do something like

Code:
$(function() { $_get('/privmsg?folder=inbox') {
if (i == +1) {
var pmtoast = document.createElement('span');
}else{
var test = document.getElementByID('pmtoast');
test.style.display == none;
}
});

something like that Smile not sure about what i'm currently writing but that's the idea

4
Need assistance Empty Re: Need assistance Sun Sep 28, 2014 1:09 am

LOLWesta


LOLWesta King
I'm currently working on a PHP guide page that will guide you to make this feature

https://lolwesta.forumotion.com

5
Need assistance Empty Re: Need assistance Mon Dec 22, 2014 2:07 pm

sugar


Members
Members
correcting the script

Code:
$(function() {
var i = 0;
$_get('/privmsg?folder=inbox') {
if (i == +1) {
var pmtoast = document.createElement('span');
pmtoast.innerHTML('<div id="pmtoast"><a href="/privatemessageno13">{USERNAME}, you got a new message!<br>Click this message and you'll be redirected</a></div>');
}else{
var test = document.getElementByID('pmtoast');
test.style.display == none;
}
});

you'll do some regex at the code above, because we don't know what's the link, or you can neither do change the '/privatemessageno13' to '/inbox' if you want to. then what i know about regex is you can change the value of the url by made some '$1' to it, dunno ?

6
Need assistance Empty Re: Need assistance Tue Dec 23, 2014 6:08 am

LOLWesta


LOLWesta King
Yep, you right. We have to do some Regular Expressions on the code, basically you can search for the references at W3Schools or MDN. Don't open W3Schools if you believe W3Fools message. Then you can set some loop to load the Inbox. Or you can do it with PHP easily, then store the data at the PHP script to your forum. You can read about it in some topic I'll create for the reference. [Link] You can ask in the thread if you don't understand about it.

PM Toast just work the same like notifications. Notifications are made with regex and loop thought.




Anyway, for the 'You have no new message' replacing, I just try some simple Javascript. It won't work correctly.

Code:
var ibx = document.getElementById('mainmenu').innerHTML = ' ';
var ibx = document.createElement('a');
ibx.innerHTML = "<a href="/pm">Inbox</a>
document.getElementById('ibx').appendChild(a);

https://lolwesta.forumotion.com

7
Need assistance Empty Re: Need assistance Tue Dec 23, 2014 8:08 am

sugar


Members
Members
for the 'you have no message' replacing we'll just figured it out together and find the solution. so you don't need to help for the 'you have no new message'. but we met the script at some site so that's not our script that we made together.

we have so many references in our way, and maybe this project would be some easy-peasy project to wrote at. basic html, medium javascript, and basic php. with the minor : basic css. this project would be a cool project and easy project to do. but since i'm not in my own laptop right now i'll just have to chill.

8
Need assistance Empty Re: Need assistance Tue Dec 23, 2014 8:24 am

Test Account


Members
Members
But, there was still a miles to go and we shouldn't leave our project as easy as that. We should help each other even if we're still busy. But I believe that this project will ends in a few days. Don't just leave the project that easily.


I'll do the regex and the loop.

9
Need assistance Empty Re: Need assistance Fri Jan 16, 2015 5:56 am

LOLWesta


LOLWesta King
The PM Toast wasn't be a simple code anymore. Btw you need to encode the PM title and decode it Wink because we don't know really sure if the message wasn't 'decorated' by some special symbol or something. It will read it AS REGEX if you don't encode-decode it. 

You'll do something like

Code:
var ibx = document.getElementById('inbox').innerHTML; /* this will renders the inbox to html */
if(ibx === null) {
console.log('Null'); /* it will checks nether if inbox are null or not */
}
else
{
console.log('Available'); /* this means the inbox link was available */
for(var i = 0;i<ibx;i++) {
/* content here */
}
}

Seems that way.

https://lolwesta.forumotion.com

10
Need assistance Empty Re: Need assistance Sun Jan 18, 2015 12:42 am

Left


Members
Members
It's not $_get, it's $.get Smile

11
Need assistance Empty Re: Need assistance Mon Jan 19, 2015 7:30 am

Tsu


Members
Members
Yep, it's jQuery.get or shorter $.get ; $_get was PHP AJAX. Very Happy anyway, we should create some cookie to close the PM toast unless it would appear forever. Anyway there's some plug-in called jquery-cookie by carhartl from git that the webmaster uses here. It's a great function even it's jQuery. Smile

So some functions was

$.cookie('name', 'value'); to create a session cookie.
$.cookie('name', 'value', {expires: 10}); to create an expiring cookie that will deleted if it's already 10 days.
$.cookie('name', 'value', {expires: 10, path: '/'}); to make an expiring cookie that enables cross entire website.
$.cookie('name'); to read a cookie
$.cookie(); to read ANY AVAILABLE cookies, it will returns {"name" : "value"}
$.removeCookie('name'); then it will returns true if the cookie was successfully deleted, otherwise false

You can just read the doc at git if you'll like to see more Wink

12
Need assistance Empty Re: Need assistance Tue Jan 20, 2015 10:51 am

LOLWesta


LOLWesta King
I'm currently packing this project somewhere in my laptop if that're allowed. Also I will submit the tutorial to any sites that accepts forumotion tutorials. I've currently named the file as inbox.js after I named it inboxAPI.js lol. Somehow it made my brain to work and I've made the code myself that are working. And there's so many, many fixes around this script. I've also created the doc myself and added some functions like

Code:
var inbox = {
disableToast : "false", // this will be false if you want to disable the toast, this will be true if you want to enable the toast
stylingToast : "false" //this will be false if you want the toast to be plain, this will be true if you want the toast styled
enableJSON : "true" // set this to true if you want it to enable some topic that will be used to store pseudo database with json type that will contains like subject{hi} message{this is the private message} sendedBy{userA} sendedTo{userB}
}

and currently I make some global functions for it that it will store the entire inbox and used a topic as some pseudo database to store the inbox like

Code:
{
"subject" : "Hi.",
"message" : "This is the private message. Oh hey dude.",
"something" : "something",
"whatever" : "Whatever things here",
"foo" : "Foo was already filled with bar",
"bar" : "Bar was filled by foo",
"test" : "testing"
}

https://lolwesta.forumotion.com

13
Need assistance Empty Re: Need assistance Tue Mar 03, 2015 1:11 pm

Tsu


Members
Members
You have to iterate the data with for loop. Do search 'iterate data javascript' in Google; or access this link : http://lmgtfy.com/?q=iterate+data+javascript

14
Need assistance Empty Re: Need assistance Tue Mar 03, 2015 1:13 pm

Tsu


Members
Members
By the way, if you do store the private messages information in a pseudo database (read : topic), then the 'Private Message' isn't a Private Message anymore, it's a 'Public Message'. Better to didn't use the pseudo database. This is just creating a PM box, after all.

15
Need assistance Empty Re: Need assistance Wed Mar 04, 2015 6:51 am

Left


Members
Members
Yes, that is true. It's insecure to store the datas in pseudo database, because maybe the PM contains private info, such as passwords, address, etc.

Sponsored content


View previous topic View next topic Back to top Message [Page 1 of 1]

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