151

(11 replies, posted in Programming)

hmm, am I that stupid hmm

Array
(
    [0] => user_id_2_fbconfig.png
    [1] => userid_20_userid_2_ - kopie.png
    [2] => userid_2_fbconfig.png
)

$user_id = '/^userid_'.$pun_user['id'].'_(.*?)/';

$i = 0;
  foreach ( $files as $key => $file ) {
    if ( preg_match( $user_id, $file ) ) {
      $i++;
    }
  }
  echo '<p>'.$i.'</p>';

Now it shows just 1 if $user_id = 2

I do not know why it did not work the first time hmm
Can I now also safely say that only the first userid_2_ is counted, this because when someone uploads a file that is called userid_50_userid_2_.png
that not the second userid_2_ is getting counted?
the first userid is added by the script to determine who uploaded the file.

152

(11 replies, posted in Programming)

I thought so to but

$i = 0;
  foreach ( $files as $key => $file ) {
    if ( preg_match( $user_id, $file ) ) {
      $i++;
    }
  }
  echo '<p>'.$i.'</p>';

does not give anything.

153

(11 replies, posted in Programming)

Hi,

Lets say that I have the next array:

Array
(
    [0] => user_id_2-fbcss.png
    [1] => userid100_ spongebob - kopie (2).jpeg
    [2] => userid2_kierownik stamplaatje definitief 1 - kopie - kopie.jpg
    [3] => userid2_spongebob&&&.jpeg
    [4] => userid2_spongebob&&&kopie.jpeg
    [5] => userid2_test.jpg
    [6] => userid3_kierownik stamplaatje definitief 1.jpg
    [7] => userid5_kierownik stamplaatje definitief 1 - kopie (2).jpg
    [8] => userid5_spongebob - kopie - kopie.jpeg
)

Now I want to count the number of files containing 'userid2'.

I have tried preg_match but I do not understand those expressions and also tried str_replace but till now no luck sad

Can anyone tell me how I can do that.

154

(17 replies, posted in PunBB 1.3 troubleshooting)

I think that the updat would be easy, just upload all the files. Because we do not need to change any of the files we can safely replace the files.
I think smile

155

(22 replies, posted in PunBB 1.3 extensions)

Yes when you post it it works, great work smile

156

(22 replies, posted in PunBB 1.3 extensions)

the pungeshi looks nice but he does not work in you preview your post first hmm

Why not make an extensions of it hmm

158

(151 replies, posted in PunBB 1.3 extensions)

When are the hooks in parser.php coming so that people can make there own bbcode?

With this extension you can generate a list of your extensions that you can place in a post on your forum.

Only for Punbb 1.3.

download at Punres.org

I do not think they will be included in the download, but they will be official supported.

aha, I did not know that, thanks.

Why are the posts at http://pundemo.kierownik.nl/search/posts/user/2/ not bbcode parsed, or did you guys forget it smile

This extension adds the avatar to the userlist.

Settings are in => Profile - Settings.

Download at Punres.org.

164

(4 replies, posted in PunBB 1.2 troubleshooting)

I had a simaler problem so I know how you could look over it smile

165

(4 replies, posted in PunBB 1.2 troubleshooting)

if you use 1.2.17 then

this line:
$links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';

should look like:
$links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'&csrf_token='.sha1($pun_user['id'].sha1(get_remote_address())).'">'.$lang_common['Logout'].'</a>';

Adds Google Analytics V1.0.4 to your punbb forum.

Only for Punbb 1.3.

Options:
Exclude admin pages
Exclude usergroups

Download at punres.org

I will see what I can do.

168

(34 replies, posted in PunBB 1.3 troubleshooting)

Changed it into:

rewrite_rules.php

'/^gallery(\.html?|\/)?$/i'                             => 'index.php?gallery',
'/^gallery[\/_-]album[\/_-]?(.*?|\/)(\.html?|\/)?$/i'  => 'index.php?gallery=&album=$1'

Folder_based.php

'gallery'        => 'gallery/',
'gallery_album'  => 'gallery/album/$1/'

And I had to change manifest.xml because all the scripts and css used PUN_ROOT and then with folder_based they did not load, changed it into $base_url.

Thanks for all the help daris smile

Adds Google Analytics to your punbb forum.

Only for Punbb 1.3.

Download at punres.org

170

(34 replies, posted in PunBB 1.3 troubleshooting)

Thanks daris, it works smile

the only thing that does not work is folder_based.php, he does not seem to do something with / but he does with - hmm

171

(34 replies, posted in PunBB 1.3 troubleshooting)

Thanks for trying daris, I also tried your code but I am now using index.php?gallery&album=$1

I tried to replace it in your code but I still do not get the album sad

[edit] version that I now use you can download here http://kierownik.nl/download.php?actie=bekijk&id=13

172

(34 replies, posted in PunBB 1.3 troubleshooting)

Yep now I see, changed it into:
  '/^gallery[\/_-]album[\/_-]?([A-Za-z0-9-]+).*(\.html?|\/)?$/i'  => 'index.php?gallery&album=$1'

but now going to http://pundemo.kierownik.nl/gallery-album-Lightbox.html will not show that album

phoe phoe, that sef url thing is more difficult than I thought roll

[edit] It seems that $_GET['album'] cannot be found hmm

173

(34 replies, posted in PunBB 1.3 troubleshooting)

changed it to
  '/^gallery_album[\/_-]?([A-Za-z0-9-]+).*(\.html?|\/)?$/i'  => 'index.php?gallery&album=$1'

but still get the Bad request hmm

174

(34 replies, posted in PunBB 1.3 troubleshooting)

searched the web about arbitrary elements but could not find any good explanation for it in my language so I used http://babelfish.altavista.com/tr that tells me that arbitrary elements are random elements. What I am then asking myself is, what elements.

I know that everyting looks like I want to, so too how the links should look like e.g. gallery/album/Lightbox but then after clicking I get the Bad request.

I think my mistake is in the line:
  '/^gallery_album[\/_-]?([0-9]+).*(\.html?|\/)?$/i'  => 'index.php?gallery?album=$1'

175

(34 replies, posted in PunBB 1.3 troubleshooting)

Latest SVN = 1537

rewrite_rules.php

<?php

$pun_rewrite_rules_gallery = array(
  '/^gallery(\.html)?$/i'                             => 'index.php?gallery',
  '/^gallery_album[\/_-]?([0-9]+).*(\.html?|\/)?$/i'  => 'index.php?gallery?album=$1'
);

$pun_rewrite_rules = array_merge($pun_rewrite_rules, $pun_rewrite_rules_gallery);

Default.php

<?php

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
  exit;

$pun_url_gallery = array(
  'gallery'       => 'index.php?gallery',
  'gallery_album' => 'index.php?gallery&album=$1'
);

$pun_url = array_merge($pun_url, $pun_url_gallery);

File_based.php

<?php

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
  exit;

$pun_url_gallery = array(
  'gallery'       => 'gallery.html',
  'gallery_album' => 'gallery.html&album=$1'
);

$pun_url = array_merge($pun_url, $pun_url_gallery);

File_based_(fancy).php

<?php

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
  exit;

$pun_url_gallery = array(
  'gallery'         => 'gallery.html',
  'gallery_album'  => 'gallery/album_$1.html'
);

$pun_url = array_merge($pun_url, $pun_url_gallery);

Folder_based.php

<?php

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
  exit;

$pun_url_gallery = array(
  'gallery'        => 'gallery',
  'gallery_album'  => 'gallery/album/$1'
);

$pun_url = array_merge($pun_url, $pun_url_gallery);
echo "<li class=\"topactive\"><a href=\"".pun_link ( $pun_url['gallery_album'], array($li_gallery_name, sef_friendly ( $li_gallery_name ) ) )."\"><span>".htmlentities ( $dir )."</span></a></li>";

and $li_gallery_name gives the &_GET['album']