Jump to content

Norin

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by Norin

  1. This is kind of why I am asking for advices on how I should start, so that eventually I can fulfill the project... About frameworks, what would happen if I started using one and it died ? (Discontinued...)
  2. Thanks everyone ! As for the questions, the project is an Internet website aiming for a very large traffic rate. It is reasonable to plan for dozens of thousands of visitors per day, maybe more. The need for security is probably above average, on one side, no credit transaction will be done. However, a breach in our security would result in a major loss in our users due to the dirt on our reputation and the fact that we will be holding information about them in our database. The project consist mainly of a news website combined to a social community system. This means that there will be a very large amount of data on the database due to our users being able to create groups, comment on news, add articles which can then be commented, etc. The application needs to be very flexible so we can add features over time to add value to the whole website. The target audience is mainly males between 15 and 35 and females between 21 and 34, both close enough to the world of technologies. I am the only developer on the team, however there are people working on design and business plan. About the frameworks, I was told that if someone learn a framework, he basically learns the framework instead of PHP, which is actually a bad thing... What do you think about this statement ? Also, doesn't frameworks usually have template for the MVC? Thanks again !
  3. Hello everyone, I have started PHP not so long ago and I must admit that this whole world is quite confusing. On the internet, we can find everything... A link saying that we should press A and not B, another saying that A must not be pressed and B shoud etc. When looking on the web to learn about PHP, I often find myself more confused at the end of the day than at the beginning of the day. So I would like to know, with all you've learned in the past years, what would be the best advice you could give to a newbie who's been assigned on a big project and who wants to learn PHP properly ? Would you tell him to use a templating system ? Would you tell him to use a PHP framework ? Would you tell him to use a caching system to store some data ? What else should be taken in consideration ? PS: Flexibility is a must for this project Thanks !
  4. Thanks a lot ! I followed your advice and could get it partly done. Seems like everybody is okay to remove the whole [iF] pattern since I said that I would code it on my own in the PHP file (told em that it would be faster too since I'd be saving on manipulations). However, they absolutely want no PHP in the HTML file, so what will happen is that I will do the whole PHP file by including all the if etc and will only replace the {} tags. They told me that this was a must since it would allow everyone to continue working on the HTML files (they also create a document with each HTML file explaining what {} tags must contains).
  5. It's unfortunately not really in my power to ask to change how the project was planned. There have already been a bunch of pages created using the [iF] and {} values. Would it be possible to focus on how to achieve the initial goal please ?
  6. As I said earlier, I need to seperate my logical and graphical units for the website. I will be working with people who have absolutely no clue about PHP, these people need to be able to create their own HTML file while someone else will be working on the PHP.
  7. Hello everybody, I've started to work on building my own template engine for my website since I need to seperate the logical units from the graphical units and template engines such as Smarty and TBS are way too big for what I really need: a very basic, simple template engine which manage simple tasks such as value reference and conditions. The value referencing has been quite easy, a simple str_replace would do the job correctly. Where it gets complicated is at the conditional management. I need it to make, for exemple: [iF USER_STATUS_ADMIN]{SHOW_ADMIN_LINK}[ELSEIF USER_STATUS_WRITER]{SHOW_WRITER_LINK}[ELSEIF USER_STATUS_TESTER]{SHOW_TESTER_LINK}[ELSE]{SHOW_ALL_LINK}[/iF] turn into: if $user_status_admin { echo $show_admin_link; }elseif $user_status_writer{ echo $show_writer_link; }elseif $user_status_tester{ echo $show_tester_link; }else{ echo $show_all_link; } I must admit that I am quite rusted in PHP, so to reach this goal I first thought about using a regex to dispatch all my values... I used this regex: /\[iF (.*?)\](.*?)(\[\/IF\]|\[ELSEIF (.*?)\](.*?)\[\/IF\])/i Before long I realized that I could only retrieve a single ELSEIF value. So I went with a string scaning method using this code: $str = '[iF USER_STATUS_ADMIN]{SHOW_ADMIN_LINK}[ELSEIF USER_STATUS_WRITER]{SHOW_WRITER_LINK}[ELSEIF USER_STATUS_TESTER]{SHOW_TESTER_LINK}[ELSE]{SHOW_ALL_LINK}[/iF]'; $pos = strpos($str, '[iF '); A new problem arose... Finding the first "[iF " was going fine, but finding the USER_STATUS_ADMIN between "[iF " and "]" was giving me trouble... So here I am now, which method I should focus my energy on and how to achieve my goal. Any help on the matter would be greatly appreciated, Thanks !
  8. Nope, thats the code I was using :-\ I dont know if it has something to do with my use of tinybutstrong in the file... [templates using many blocks then ONE show]
  9. Your code does what I would like to do but instead of having a numbers of times a number is shown, I'd like it to include a page. I tried to replace the "for" with my "include" but it does not work... It just waits untill it has loaded everything THEN it shows everything in one block.
  10. well, if I could simply "prepare" the page while displaying a message THEN display the page when it is ready, it would be perfect
  11. Hello, I'd like to add a Loading screen to my web site but the problem is that this loading screen must appear BEFORE the page actually load. When I open my site, it says "Waiting for localhost..." then everything appears really fast, so all the loading scripts I found are not working since they get activated while the page is loaded, which is really fast. I'd like the loading to show when it says "Waiting for localhost..." I tried to make a php file to redirect to my page but showing "Loading..." but I did not got it working. Thanks
  12. Norin

    Sessions

    Im also using an array for my session, wonder if the ID would give better performances ???
  13. Greetings everybody, first of all, I am sorry for posting multiple questions in one topic, but I thought it'd be better to make one topic rather than having many topics. I am actually working on a php-based game and I've encoutered some problems. First of all, I've got some problem while trying to make a function that would allow me to get a random item as a drop from a monster. The problem is, each item has a % chance to be dropped. I made a function that allowed me to do this: function randomPrc($itemSQL) { $drop = array(); foreach($itemSQL as $item) { for($i=0;$i<($item['prc']*10);$i++) { array_push($drop, $item['item']); } } $randDrop = rand(0,count($drop)); $currDrop = $drop[$randDrop]; echo $currDrop; } But as you can see, the 'No drop' is impossible with this function and it has to make an array of around 1000 values which is actually really big. So I was wondering if there was a way to do this in a way that'd be more effective. Table & Session: Another problem I have is more a "Which is the best way to go" problem. Let's say for exemple that a player go fight a monster. I have the base information concerning that monster in a table. Should I create a table which would contain temporary informations like, how much HP/MP that monster have left or should I try to get my way through SESSION array containing those informations? When the player dies, he can go to the hospital. So I was thinking to use tables with a date, then compare the date where he went to the hospital with now [saying he cant go to the hospital more than once by 10minutes] But it would require lot of information in my player table... Anyone know a more effective way to get this done? Finally, my last question, which way would be the best. If for exemple my player has parts (Head, right/left arms...) where he can use some items. Should all my items be in one big table, or should I separate all of them? Actually, most items have the same stats but the armors gives def and weapons gives attack. Sorry if it was long, Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.