1 (edited by scottywz 2005-06-04 22:26)

Topic: [Release] User subscriptions 1.0

Inspired by this post, this admin/moderator plugin allows you to see what posts users are subscribed to. It is based on the DB Management plugin by Connorhd.

Download instructions (if you don't want to go to the PunBB downloads page):
1. Go to http://phpxplorer.scottywz.com
2. You are already logged in as guest. Don't try to login as me or root (the passwords here are not the default ones).
3. Click on dloads.
4. Click on PunBB.
5. Click the arrow next to AMP_User_subscriptions.zip.
6. Extract and upload like a regular plugin.

I can't give you a direct link to the download due to its location in my Web hosting account.

Enjoy!

Re: [Release] User subscriptions 1.0

whoops download does work but you have to click the arrow hmm

hmm this is a really wasted plugin, it adds nothing to the query being run in my plugin, and includes LOADS of php you don't need

Re: [Release] User subscriptions 1.0

I can clean it up, and I did say to click the arroew.

Re: [Release] User subscriptions 1.0

i wouldn't use my plugin at all, its a waste of space, all you need to do is run the query and output it in a table, if you wanted to be clever you could make it so that it was grouped by topics

5

Re: [Release] User subscriptions 1.0

connorhd wrote:

whoops download does work but you have to click the arrow

It is phpxplorer file manager.

scottywz:
You are a newbie in programming, keep try to clean your code and Finish it as in "Mortal Combat" smile

If your people come crazy, you will not need to your mind any more.

Re: [Release] User subscriptions 1.0

Finish Him! Fatality! SubZero Wins!

sorry back on topic now wink

7 (edited by Ataxy 2005-06-05 02:11)

Re: [Release] User subscriptions 1.0

scottywz wrote:

Inspired by this post, this admin/moderator plugin allows you to see what posts users are subscribed to. It is based on the DB Management plugin by Connorhd.

Download instructions (if you don't want to go to the PunBB downloads page):
1. Go to http://phpxplorer.scottywz.com
2. You are already logged in as guest. Don't try to login as me or root (the passwords here are not the default ones).
3. Click on dloads.
4. Click on PunBB.
5. Click the arrow next to AMP_User_subscriptions.zip.
6. Extract and upload like a regular plugin.

I can't give you a direct link to the download due to its location in my Web hosting account.

Enjoy!

i get this
SELECT u.username, t.subject FROM punbb_subscriptions AS s LEFT JOIN punbb_users AS u ON s.user_id=u.id LEFT JOIN punbb_topics AS t ON s.topic_id=t.id;

but the plugin is working its just that this appears at the top of the list of subscribe post

Re: [Release] User subscriptions 1.0

I'll clean up the code and fix that probably by mid-tommorow.

Re: [Release] User subscriptions 1.0

<?php
/***********************************************************************

  Copyright (C) 2005  Connor Dunn (Connorhd@mypunbb.com)

  This software is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  This software is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

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

// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);

    generate_admin_menu($plugin);
?>
    <div class="block"> 
        <h2><span>User Subscriptions</span></h2> 
        <div class="box"> 
            <div class="inbox"> 
                <p>Shows you what topics users are subscribed to, grouped by username</p>
            </div> 
        </div> 
    </div> 
    <div class="block">
        <h2 class="block2"><span>User Subscriptions</span></h2>
        <div class="box">
            <div class="inbox">
                <table class="aligntop" cellspacing="0">
                    <?php
$result = $db->query('SELECT u.username, t.subject FROM '.$db->prefix.'subscriptions AS s LEFT JOIN '.$db->prefix.'users AS u ON s.user_id=u.id LEFT JOIN '.$db->prefix.'topics AS t ON s.topic_id=t.id ORDER BY u.username;');

while ($row = $db->fetch_assoc($result))
{
    if (!isset($last_user)) {
        echo "<tr>\n\t\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t\t".$row['username']."\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span>";
        echo $row['subject'];
    }
    elseif ($last_user == $row['username']) {
        echo ', '.$row['subject'];
    }
    else
    {
        echo "</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t\t".$row['username']."\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span>";
        echo $row['subject'];
    }
    $last_user = $row['username'];
}
echo "\n"
?></span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

much better, it displays properly, it doesn't use the db plugin so its not full of all the stuff from that, and it groups by username

10

Re: [Release] User subscriptions 1.0

Connorhd wrote:
<?php
/***********************************************************************

  Copyright (C) 2005  Connor Dunn (Connorhd@mypunbb.com)

  This software is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  This software is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

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

// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);

    generate_admin_menu($plugin);
?>
    <div class="block"> 
        <h2><span>User Subscriptions</span></h2> 
        <div class="box"> 
            <div class="inbox"> 
                <p>Shows you what topics users are subscribed to, grouped by username</p>
            </div> 
        </div> 
    </div> 
    <div class="block">
        <h2 class="block2"><span>User Subscriptions</span></h2>
        <div class="box">
            <div class="inbox">
                <table class="aligntop" cellspacing="0">
                    <?php
$result = $db->query('SELECT u.username, t.subject FROM '.$db->prefix.'subscriptions AS s LEFT JOIN '.$db->prefix.'users AS u ON s.user_id=u.id LEFT JOIN '.$db->prefix.'topics AS t ON s.topic_id=t.id ORDER BY u.username;');

while ($row = $db->fetch_assoc($result))
{
    if (!isset($last_user)) {
        echo "<tr>\n\t\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t\t".$row['username']."\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span>";
        echo $row['subject'];
    }
    elseif ($last_user == $row['username']) {
        echo ', '.$row['subject'];
    }
    else
    {
        echo "</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t\t".$row['username']."\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<span>";
        echo $row['subject'];
    }
    $last_user = $row['username'];
}
echo "\n"
?></span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

much better, it displays properly, it doesn't use the db plugin so its not full of all the stuff from that, and it groups by username

hey connorhd what do i do save that script as  AMP_User_subscriptions.php and upload it to my plugin folder

Re: [Release] User subscriptions 1.0

yeh i guess i should zip it up i was just doing it to show scottywz

12

Re: [Release] User subscriptions 1.0

wow connorhd that one is realli good

Re: [Release] User subscriptions 1.0

if someone wanted to improve it, you could make a button to switch between grouped by user and grouped by topic, and add pages

Re: [Release] User subscriptions 1.0

Someone could add a button to delete a certain subscription. Maybe even checkboxes so you could delete multiple subscriptions.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [Release] User subscriptions 1.0

In post #9, Connorhd wrote:

much better, it displays properly, it doesn't use the db plugin so its not full of all the stuff from that, and it groups by username

Oh. I guess it is better. smile

Re: [Release] User subscriptions 1.0

Connorhd wrote:

Finish Him! Fatality! SubZero Wins!

sorry back on topic now wink

Finish who? Fatality to what? Who/what is "SubZero"?

Last edited by Angry User (Today 22:28:34)

Re: [Release] User subscriptions 1.0

i was referring to what it says in mortal kombat

zaher wrote: Finish it as in "Mortal Combat" smile.

if you want feel free to add checkboxes to remove subscriptions like rickard said and add the things i suggested.

18

Re: [Release] User subscriptions 1.0

Hum...
Before deleting a subscription, should'nt the admin ask the person who subscribe if she wants to keep this subscription active or not?
Isn't it possible to "mark" the subscription as "to be deleted in X days" and automatically send an email to the subscribed person with a warning?

Re: [Release] User subscriptions 1.0

ext: That would make things 200 times more complicated.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [Release] User subscriptions 1.0

if you want to be nice you could make it only 10 times more complicated and just send out an email saying the subscription has been removed wink

21

Re: [Release] User subscriptions 1.0

"Mortal Combat" is a famous fighting game, i meant when you study programming you must finish any thing that you started.

I prefer delete subscriptions for very non active old topics or non active user (depend on last visited)

If your people come crazy, you will not need to your mind any more.

22

Re: [Release] User subscriptions 1.0

Connorhd wrote:

if you want to be nice you could make it only 10 times more complicated and just send out an email saying the subscription has been removed wink

Hmmm, that's OK too, as long as the person who subscribed is warned.

Re: [Release] User subscriptions 1.0

What about something where the user could see their subscription(s)?

Re: [Release] User subscriptions 1.0

you mean like the button on the forum homepage at the bottom?

25 (edited by scottywz 2005-06-15 21:34)

Re: [Release] User subscriptions 1.0

Oh. Nevermind. If only I had known about/remembered that. smile But maybe add an option to remove each/all posts right from that screen.