Nicht angemeldet. · Kennwort vergessen · Registrierung deaktiviert
Forum: Übersicht Files & Mods / Datein & Mods RSS
Integrate with user login?
mrpool #1
Mitglied seit 09/2008 · 3 Beiträge
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Betreff: Integrate with user login?
First off, I love the plugin, it is exactly what I was looking for, but now I realize that I wanted to do a little more, lol.  I love the simplicity of the plugin, yet it has a ton of options/features.  I haven't found anything that compares.

My issue:  I want to enable users to login to my blog, only as subscribers, but in the Profile screen I would like to have the subscription options.  I've got it so that post_notification info shows up in the profile.php from wordpress.  The problem I'm having is getting it to validate the user that is logged in.  It pulls the email address fine, but needs the "code" before it will display the subscription options.

Any ideas?  I was trying to get it to pull the code for the currently logged in user.

Thanks again!

Michael
http://www.homeshade.com
mrpool #2
Mitglied seit 09/2008 · 3 Beiträge
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
lol, it's amazing what some good coffee can do!

I think I got it figured out:

First, in the wp-admin\user-edit.php file, after:
<div class="wrap" id="profile-page">
<h2><?php $is_profile_page? _e('Your Profile and Personal Options') : _e('Edit User'); ?></h2>

add:
<?php include('../wp-content/plugins/post-notification/post_notification_template.php');?>

Next, in the frontend.php file I made the following change:

    // ******************************************************** //
    //                  GET VARIABLES FROM URL
    // ******************************************************** //
    $user = wp_get_current_user();
    $addr = $user->user_email;
    $t_emails = $wpdb->prefix . 'post_notification_emails';
    $code = $wpdb->get_var("SELECT act_code FROM $t_emails WHERE email_addr = '$addr'");
    $action = $_GET['action'];
//    $addr   = $wpdb->escape($_GET['addr']);
//    $code   = $wpdb->escape($_GET['code']);

You can see where I commented out the original $addr and $code, and added the $user, $addr, $t_emails, $code lines.

and that's it.  When the user logs in, under the profile tab the subscription listing is at the top of the profile page.

Oh, and on in the plugin Settings for PN, set the 'Link to the Post Notification page' to:
http://yourblogdomain.com/wp-admin/profile.php
Obviously the notification email and such will have to reflect the profile.php change, but that's easy enough.

I'll post an example login shortly if anyone wants to see what it looks like.  I want to clean it up a bit first and try to get the subscription options on it's own page in the Profile area instead of under the personal settings.


Michael
http://www.homeshade.com
mrpool #3
Mitglied seit 09/2008 · 3 Beiträge
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Ok, just figured I would follow up for anyone that might care...

Scratch the user-edit.php addition, don't need it any more.

Keep the addition to the frontend.php file as I noted before.
In the post-notification.php file I added the following under the post_notification_admin_adder() function:

/// Add the User panel
function post_notification_user_adder(){
    $uname = add_users_page('Your Subscriptions','Your Subscriptions', 0, 'post_notification/post_notification_template.php', 'post_notification_fe');
   
}

Then, down at the bottom, after:
// Admin menu
add_action('admin_menu', 'post_notification_admin_adder');

I added:
add_action('admin_menu', 'post_notification_user_adder');

and I, if I recall correctly, I think that was it to get it integrated with user login...
I used several other plugins to get the login page and all that setup as I wanted, but it all came together I think.

If you want to see the end result go to http://homeshade.com and click on the Login/Subscribe page, use the following login:
username:  test2
password:  test

You should see the 'Your Subscriptions' section in the user profile.

Michael
rachely476 #4
Mitglied seit 11/2010 · 1 Beitrag
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
It really useful for me, thanks for the info that you guys have been discussing.
watch movies online for free
uird #5
Mitglied seit 07/2011 · 1 Beitrag · Wohnort: http://www.wowbenz.com
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Thanks!
http://www.super-seriale.pl/uyuutrie/blog/18007/
http://www.us.splinder.com/myblog/post/593639/1101334/yes
http://alvitaa.com/node/3332
wow goldpower levelers.cheap wow gold of the typical World of Warcraft.http://www.wowbenz.com
cyndihuang #6
Mitglied seit 09/2011 · 7 Beiträge
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Antwort auf Beitrag ID 2576
Thank you for sharing info...... :rolleyes:
Schließen Kleiner – Größer + Auf diesen Beitrag antworten:
Prüfcode: VeriCode Gib bitte das Wort aus dem Bild ins folgende Textfeld ein. (Nur die Buchstaben eingeben, Kleinschreibung ist in Ordnung.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Weitere Zeichen:
Gehe zu Forum