Jump to content

torb

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Posts posted by torb

  1. Hi there! I have been browsing for quiiite a few hours both here and in the PHP manual looking for a simple way to find some characters in strings.

     

    I've tried regex and all sorts of preg_matches and whatnot, but my skills simply aren't there.

     

    Anyways, here's my example. Let's say a forum post string reads like this...

    Sed fermentum velit vel orci posuere nec ultrices lacus congue. Phasellus non justo non nibh elementum consectetur. Praesent ut magna orci. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

    [special]42

    Quisque id mi turpis, in fringilla tortor. Vestibulum rutrum adipiscing lacus. Duis auctor cursus consectetur. Quisque id arcu at eros laoreet vulputate. Nam tincidunt nunc id sem sagittis pharetra. Aenean eu sapien ut quam dapibus ultrices.

     

    ...then I want the result value 42 in a new variable.

    So basically, I want the two characters AFTER [special] as a new variable...

     

    Any help is greatly appreciated! :)

     

    -torb

     

    PS: I would be very willing to change it to [special]42[/special] to make it look more like bbCode.

  2. I think one of the reasons that people get different results when looking at your site is that it isn't valid html. See http://validator.w3.org/check?uri=http%3A%2F%2Fwww.ucy.in%2Ftcmb%2F&charset=(detect+automatically)&doctype=Inline&group=0 for errors

     

    I feel sort of bad for you, and feel you should try to get some help with the design of your site. I know my thoughts may be irrelevant, but here are some of my hints at what would make it more appealing :) :

     

    1) Less information

    People who are on the net have so much to chose from that they rarely read an entire page. So keep only the vital bits. Learn how to write copy - skip stating obvious things like "click on CONTACT to open the address." People know it is a link and will click it if they need it ;)

     

    2) Less clutter

    When you have less information displayed this may longer be a big issue. The main thing is to not fall into the trap of EXPLOITING all the Different typographical features. They will fight for attention, and the end-user will lose out (eg. your left-side menu alone uses at least 3 different styles for links).

     

    3) Cave in, go for a template

    Don't be afraid to use a free template - the end result will be a lot better, even if you can't say 'I made it all myself'. Think of the people who will be visiting your site rather than thinking of your craftmanship - you can do more work later. Most (if not all) webmasters have started with virtually no design skills. How about starting off with a template and then modifying it bit-by-bit over the months into it becomes something you can call your own, and is still something that end users will want to visit?

     

    With a decent CSS template, you will also get much better results in search engines.

    With a decent CSS template, you will also get friendly design and content that is properly and logically structured and styled.

     

    Search results=new members=more money? ;)

    Friendly design=new members=more money? ;)

     

     

    ...More to the point, I tried testing the log-in-area, started with the CAPTCHA 'crossed-box' and all the javascript notifications, although polite, just annoyed me to the point I gave up right away.'

     

    I sincerely wish you the best of luck. :)

     

    Inspiration:

    http://www.csselite.com/

    http://cssvault.com/

    http://www.smashingmagazine.com/2006/12/21/creme-de-la-creme-of-css-list-of-css-galleries/

     

  3. Just wanted to let you guys know I just got this message (this is the markup, obviously):

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    	<meta name="robots" content="noindex" />
    	<title>Connection Problems</title>
    </head>
    <body>
    	<h3>Connection Problems</h3>
    	Sorry, SMF was unable to connect to the database.  This may be caused by the server being busy.  Please try again later.
    </body>
    
    </html>

     

    Seems odd on a dedicated server?

  4. SMF. Simple, fast.

     

    My phpBB experience is that while the software is OK, security issues usually take some time before they are taken care of, and that's a big no-no, in my opinion.

     

    XMB is OK, although it has ended up a far way behind now. It is very easy to customize, which I think is good. I've hacked my XMB to pieces.

  5. That depends on whether you choose the mainstream or the original definition of a hacker.

    I thought the original hacker was a maker of small wooden things, like furniture?  Through carving and hacking? That's where the surname comes from, I'm pretty sure ;)

  6. Yeah. What I've suspected as most likely is that the table is corrupted while the mysqld process is killed in the middle of a write. This based on what little I could find on http://dev.mysql.com/doc/refman/5.0/en/corrupted-myisam-tables.html

     

    The table is small, 100 rows at most.

    All the other tables I use are MyIsam too.

     

    I can see from my webhosting stats that I've had _some_ slow queries running in the last two years. Not many, though. About 30, I should think. Would a slow query be able to kill a write to the db?

     

     

  7. Using:

    MySQL 5.0.67-community-log

    PHP 5.2.6

     

    My problem is that one of my tables (called the_table here) crashes quite often. About twice a month it becomes corrupt, sometimes four-five times in two days. In other words, not a nice situation. This started this summer, and I've been running the site with using the exact same files/queries since November last year, so I'm thinking it might be a server issue (maybe the server was updated and I didn't notice as I am remotely hosted). Upon fixing, it usually works. Two times, I've had to remove the table and create it again. It's the only table I have trouble with.

     

    I doubt it's the queries themselves that are the problem here, since they worked so nicely before. I consider myself pretty good with queries, but I'm not so well taught when it comes to table structures and optimization.

     

    There are three queries that run on every page of my site, for handling who is on line:

     

    Delete from db those who haven't been on line in a while: (asterisk for IP.):

    DELETE FROM the_table WHERE ((ip = '**.***.***.**' && username = 'xguest123') OR (username = 'USER') OR (time < '1226938770') )

     

    Insert current status of the user:

    INSERT INTO the_table (username, ip, time, location, invisible) VALUES ('USER', '**.***.***.**', LPAD('1226939370', '15', '0'), 'URL', '0')

     

    Make sure the user only occurs once in the table:

    SELECT count(username) FROM the_table WHERE ( username = 'USER' )

     

    Additionally, a typical view of the threads will also cause the following query:

    SELECT a.aid, a.filename, a.filetype, a.filesize, a.downloads, p.*, m.*,w.time FROM posts p LEFT JOIN members m ON m.username=p.author LEFT JOIN attachments a ON a.pid=p.pid LEFT JOIN the_table w ON p.author=w.username WHERE p.fid='FORUM_ID' AND p.tid='THREAD_ID' ORDER BY p.pid ASC LIMIT 0, 40

     

    Here's the table structure:

    CREATE TABLE IF NOT EXISTS `the_table` (
      `username` varchar(32) NOT NULL default '',
      `ip` varchar(15) NOT NULL default '',
      `time` int(10) NOT NULL default '0',
      `location` varchar(150) NOT NULL default '',
      `invisible` set('1','0') default '0',
      `robotname` varchar(50) NOT NULL default '',
      KEY `username` (`username`(),
      KEY `ip` (`ip`),
      KEY `time` (`time`),
      KEY `invisible` (`invisible`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

     

     

    I heard that the priority-setting of a specific table can be altered, and that changing this might make the table more stable. However, I have no idea how changing priority works! If anybody knows if this might be helpful, please let me know - and if you know of a link or two I'm ever grateful :);)

     

    Thanks,

    -torb

  8. Sorry about the incredibly late reply. I've done something similar to a forum some time ago.

     

    What I did was that I set up a separate table for the feed. It contains these fields

     

    - User id (to join in with the user table)

    - Feed id (smallint, for unique identification. key, auto-increment)

    - Feed story (for the basic text, plus links etc)

    - Where the feed was generated (was it from the gallery? the download center? great for stats)

    - Visibility (in my system, people can chose to be invisible in the feeds, but admins can always see the activity)

    - Timestamp (so that you have a period to pick from later)

     

    I prune the table sometimes though, it grows big quite soon ;)

  9. Now users will need to login and have limit space so they dont over upload pictures and so on, and also users can check their emails from this backend.

    You can also opt to check the size of every file uploaded before they are moved from temporary storage and stored in the directory.

     

    does this need server to be done or it can be done through reseller or shared host?

    You should be able to do this on any server as long as the writing permissions for the folder are set properly (777)

     

    Also can you limit people using more than x space through php?

    Yup. You can for example set it up so that each person has his/her own folder. Then you can check the size of the folder. I think you'll have to add the size of each size in the folder to do that, though.

     

    check out filesize() or try to find some recursive script for directory size you can use for reference

  10. A wee bit confused here. OK, _very_ confused! This is the first time I work with mod_rewrite. I've been at it for a couple of hours now with no luck. :(

     

    In essence, i want to shorten the URL's to the member profiles of my forum - but I want the relative links in these profiles to link to the correct places within the board.

     

    This is my .htaccess as I've got it so far:

    RewriteEngine On
    RewriteRule ^([^/]*)/([^/]*)\.html$ /testboard/member.php?action=$1&member=$2 [L]

     

    That supposedly turns the long url

    http://www.mydomain.com/testboard/member.php?action=viewpro&member=torb

    into the friendlier

    http://www.mydomain.com/viewpro/torb.html

     

    When browsing my forum, the link to my profile is still http://www.mydomain.com/testboard/member.php?action=viewpro&member=torb when I was hoping it would be http://www.mydomain.com/viewpro/torb.html. When I go to http://www.kult-rpg.com/viewpro/torb.html it displays my profile, only now all the relative links OUT of that page point to the wrong place, as do the relative images.

     

    Can anybody please give me a hand here? Point out the obvious bit for me, please :)

     

    Thanks,

    -torb

×
×
  • 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.