thank you both...
but now, how do i get the url out of the string to do a getimagesize on it?
1 2004-03-26 10:13
Re: replace part of string. (5 replies, posted in Programming)
2 2004-03-23 08:05
Topic: replace part of string. (5 replies, posted in Programming)
if i have a string like this
"this is some text and this [img]http://url_to_image[/img] is an image".
how can i replace the part
"[img]http://url_to_image[/img]"
with
<a href='http://url_to_image' target='_blank' border='0'><img src='http://url_to_image' width='100'></a>"
or
<a href='http://url_to_image' target='_blank' border='0'><img src='http://url_to_image' height='100'></a>"
if the width is bigger then the height, i want to put width='100',
if the height is bigger then the width, i want to put height='100',
i know i can do that with getimagesize
i tried something like this to determine whether i have to use width or height:
$image = 'http://localhost/users/images/top.jpg';
list($w, $h) = getimagesize($image);
echo "<a href=".$image." target='_blank'><img src=".$image." border='0' ";
if ($w > $h) {
echo "width='100'>";
}
if ($h > $w) {
echo "height='100'>";
}
echo "</a>";
i know this works...i just don't know how to replace that part of the string..(like what i described above.
thank you
3 2004-03-13 14:12
Re: Anger. (19 replies, posted in General discussion)
It has been confirmed that it was ETA
They can't have confirmed it, ETA says it weren't them, they do not claim the attack as being theirs. Some political parties in Spain want it to be the ETA because it would be in their benefit when the elections are being held in April.
They found a detonaters and Koranic messages in a van.
It are now over 1400 wounded people and this morning they said 199 people died and there are still quite some people fighting for their lives.
12 MILLION! people joined in the street protests, 12 MILLION! wow..
4 2004-03-11 07:22
Re: Moderated forums (17 replies, posted in PunBB 1.2 troubleshooting)
1. A business wants to use a forum for customer and potential customer questions. Because these are one off posts it is open to guests. You would have to vet posts in order to avoid the "your company is crap" type of contribution.
2. A school wants to set up a bbs on its intranet. They might well want posts approved by teachers and/or trusted student moderators before the posts get onto the board.
3. A local community wants to set up a board which is going to be used by children. It would be essential that everything that happens can be controlled and monitered by adults though in that case you would want rather tighter controls than post approval is going to give you on its own.
i still dislike it.. who's gonna post on forums where it takes a day before your post shows up?? not me.. As for #1, would be better to use email instead of a forum
5 2004-03-09 07:00
Re: login.php as start page (8 replies, posted in PunBB 1.2 modifications, plugins and integrations)
i'm trying to make a login thing on my index.php as well..that uses the userdata of punbb.. see http://www.dutcholsentwins.com
(no success yet though, didn't get it to work yet)
6 2004-03-09 06:58
Re: Moderated forums (17 replies, posted in PunBB 1.2 troubleshooting)
that way, i don't see the advantage of a forum anymore...those who post messages you don't want to be posted should simply be banned.
i myself would never participate on a forum where posts have to be validated first.. that's waaaaaaaay to annoying. But that's just my opinion
7 2004-03-07 14:21
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
never mind, solved it
8 2004-03-05 07:00
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
yes, thank you, it worked.
9 2004-03-04 14:42
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
uhm, well.. i visit the forums by going to http://forum.dutcholsentwins.com
and i visit the site by going to http://www.dutcholsentwins.com
so they are both the same domain... dutcholsentwins.com
10 2004-03-04 06:51
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
but why?
anything that could fix it?
11 2004-03-03 17:50
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
this is the output when i do that:
Array
(
)
12 2004-03-03 16:57
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
this is the output, whether i'm logged in or logged out..in both cases i get this as the output:
Array
(
[username] => Guest
[is_guest] => 1
)
13 2004-03-02 18:47
Re: Managing Subscriptions... (20 replies, posted in Feature requests)
I don't need a subscribe feature at all.
The subscribe feature should've been left out, at least not a standard feature of punbb, if someone needed it someone could have written a mod for it but oh well
14 2004-03-02 18:37
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
this is what i have in config.php
$cookie_domain = '';
$cookie_path = '/';
might it have something to do with the fact cookie_domain is empty?
15 2004-03-02 15:18
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
sure thing
<?
$pun_root = './forum/nl/'; // Path to the forum root directory (must be defined)
require $pun_root.'include/common.php';
if ($cookie['is_guest'])
{
// The visitor is a guest. Do whatever.
}
else
{
// The visitor is logged in.
echo 'Hello '.pun_htmlspecialchars($cur_user['username']);
}
?>
16 2004-03-02 10:41
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
yes i have :s
17 2004-03-02 08:45
Re: $cur_user['username'] (23 replies, posted in PunBB 1.2 troubleshooting)
i just soooooooo don't get it, that code won't work for me. even if i logged in to the forum
http://www.dutcholsentwins.com/uhm.php always sees me as a guest (so nothing appears on the sccreen). I have that problem on my own computer, on someone elses computer and on the computers of school...
18 2004-03-01 07:17
Re: completely new user (7 replies, posted in General discussion)
A good book is the PHP bible. I have the Dutch version, and it's very good.
yeah same here
19 2004-02-29 13:36
Re: Add navigation button (8 replies, posted in PunBB 1.2 troubleshooting)
example of second method:
http://punbb.org/forums/viewtopic.php?id=3195
20 2004-02-29 13:20
Re: extern.php problem (2 replies, posted in PunBB 1.2 modifications, plugins and integrations)
yeah, i had the same error, they told me to put an @ before the include,
so that would be
@include............
and it worked.
21 2004-02-28 14:13
Re: PunBB for Fantastico (2 replies, posted in PunBB 1.2 discussion)
yeah, my host also has fantastico integrated with cPanel... it's nice, would be cool of punBB makes it to fantastico
22 2004-02-28 14:11
Re: Highlight Search Results (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
well, on my laptop i'm always a guest, it's a new laptop so there are/were no cookies on it yet when i tried. But after logging in i keep being a guest on that page...
23 2004-02-28 08:55
Re: Highlight Search Results (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
it is so weird, after i gave manually removed the cookie from my hd, i'm logged off from the forum, but the page i put that code on still shows me as logged in and shows my username.... mmm.
24 2004-02-27 18:30
Re: Highlight Search Results (14 replies, posted in PunBB 1.2 modifications, plugins and integrations)
for me it's the other way around, i'm always logged in, even after i logged out...
but it only shows "Hello", it does not show the username.
25 2004-02-27 15:08
Re: how to make 'users online' (12 replies, posted in Programming)
"aantal leden online" is dutch translated to english it would be "number of members online", so there you learned a bit of Dutch, whayeah you're happy now aren't you? lol
thank you both for your comments
well, a while back someone told me i should use fetch_array, but he might be wrong i'm pretty new to php and mysql.
i'm off to see how i can optimize it with your tips