 How you doing guys? Today I was trying to think of something to write a Null Show post on or at least bring some content out with And that really kind of got the thoughts rolling for a little bit and now that it's Monday and my week has gotten started I've been a little bit distracted with school So I haven't really been able to write code, but you know that isn't gonna stop me from thinking about code I did however need to sort some sort of topic out to be able to bring you guys I need I needed a topic and so I tried to brainstorm a little bit Obviously, I haven't been able to do any work with C++ now the week has began But I still wanted to post an update. So I mean Null Show came to mind I started thinking about the structure the interface and the design for like viewing the blog the blog post The small little implantation I had yesterday. I had it last night and all that jazz I tried thinking through the way I had JavaScript and PHP handle the sidebar and that sort of thing which had kind of reminded me of the few principles And the way that it worked. So how does it all happen on the back end? The way their slide bar actually gets the dates of these posts is by sort of like a naming invention the file name It looks through the directory containing the posts it grabs each file name and sorts them out in Chronicle order and like inside of an array So viewing is made easily it gets the name of each post by actually opening opening up the file and searching for the uppermost Head or two tag then the PHP code grabs that information and it uses it for the title or the identifier for that specific post And just adds it to the list like in inside the array It organizes all these things an unordered list and then like in HTML And then jQuery and JavaScript work to make it slide and make it more visually appealing and yada yada yada But the way it retrieves the date is kind of a curious thing though Because you can see an evident date timestamp at the top of each post by the right-hand side like in purple or something So what if I as the author were to ever make a mistake and give the posts real and give the real post date Not the file name, but the thing that you see in the top right What if I gave that the incorrect timestamp? What if like maybe what if maybe I was trying to modify a different post as like a skeleton for a new one? And what if I forgot to change the timestamp? I'm not really planning on rewriting the entire sidebar template code just to grab the date by looking for the file as well That seems a little unnecessary because I mean the file name is crucial to begin with But I am looking to see if I can prevent possible like dating errors with that file name concept So how would we set this up? Well, it seems kind of simple enough in JavaScript All you have to do is select the element and change the text I mean you could do that in jQuery really easily Which is like the the dollar sign inside the parentheses the name of the element and then like the dot text function of the dot HTML function the dot val function I don't really know the specific one But anyway, even though I get this feeling that I'm depending too much on the client side of the web I'm not really solving the problem I'm just masking it because the real file isn't modified when I do that It's just it's being displayed differently to the user to the viewer So JavaScript doesn't seem like a viable option to me. But what about PHP? That sort of interests me What if we set this up in PHP if we did that we would be having the global template like I always include a header dot PHP file for every Single document on null shell so I can include like the style sheet the the navigation yada yada yada And but that would examine the current document for that header to tag and start looking for a specific span inside that That has a certain ID so that way I'm able to identify. Okay. This is the date And this needs to have that purple color. It should be mixed with the header to tag yada yada yada It just makes it easier for CSS, but I still need that Inside the HTML and I'd be using that to grab it from PHP But it doesn't correspond with the date that we see from the process file name beta We would change that to what we want But grabbing the element in PHP isn't as easy if it were done in JavaScript though We can't just select an instant. We have to we can't just select that instant specifically We'd have to process some strings to be able to find the right position And this would be just looking through it in like the HTML tags yada yada yada Except we'd be using that in real strings using like the string position to function the substring function yada yada yada But do you remember that structure though? We had the header to tag and then we had the span tag inside that and that span has specific date identification So those are a couple variables that we should keep track of to make things extensible though We should probably like set up a conditional test whether or not the identifier variable that we're looking for it Actually exists or if it's an empty string So if I just happen to change that that date ID and like the CSS file or the way things work Entirely in all my documents, which is very unlikely, but I should make it insensible in case anyone else uses this code You know so if it isn't we should look for HTML tags that don't have an ID if it if that string isn't set If the idea isn't set so the idea and algorithm so far though doesn't even account for the parent element of that header to tag If we wanted to be as precise as we can be we should incorporate that into the code and logic as well But we would still be looking for the string if it if the string we're looking for if it's if the date is okay If it's what we want and if that's what we see inside the file name if they both correspond. That's fine That's good. That's what we want But if it isn't we would have to open up the current file in PHP Like we would use probably a server variable like a script name or something We would have to change that information on the fly. We would be reading that current file in to modify it script Corruption, I think I called it that in Python a couple days back or so But just that idea of opening the current script to modifying it and then having to have to run it again But that still comes to my mind though. What what will be passed to the user? What will they actually see in their browser? Will they see the new version of the page or the old version? So to avoid some flops or devoid some confusion or at least one person isn't the only person that sees the error I'm thinking we would have to Refresh the page, but how would we do that in PHP? Is that as simple as like resetting the location with like the header the header functions? I don't know. I'd have to refresh myself in PHP, but so far this seems like a valuable idea or something that we could actually do But at the same time, I don't know it is just an idea It's something I could work with to make my life easier later on and automation is better You know an ambitious programmer that works to make himself a lazy programmer is a good programmer And that's kind of the idea in the mindset that I want to leave you guys with today