members Profile page

Permalink
How can I add the members ID and avatars to a members page?

Jdial
 
sniggitysnax replied on at Permalink Reply
sniggitysnax
Not entirely sure what you're trying to do here, but you could essentially do something like the following:
To Display the User's Name(change to getUserID if preferred)
<?php
  $u = new User();
  if($u->isLoggedIn()) {
    echo 'Hello '.$u->getUserName();
  }
?>

And to display the user's avatar:
<?php
$u = new User();
if($u->isLoggedIn()) {
$user = $u->getUserID();
?>
<img src="<?php echo DIR REL ?>/files/avatars/<?php echo $user?>.jpg"></img>

I believe that should do the trick. I tested it a little on my own install and it seemed to do what you were inquiring about.
Jdial replied on at Permalink Reply
Jdial
Not to be a total noob but I am, this is my first concrete 5 web site so if I could request a bit more info. I get the concept of what your saying but I'm not sure where to put this info. (Maybe this can help us both to educate me) This is the files from the theme called "imagine" (it has the members page I want)

images   
js
blog.png
blog_entry.php   
default.php   
default.png
description.txt
full.php
full.png
left_sidebar.php
main.css   
sidebar_left.png
styles.css
thumbnail.png
typography.css


These are from the theme I want to use called "Halloween". It had a broken members page after install that required view.php so I created the view.php you see here, now the page loads correctly but doesn't have the members area on it.
img
default.css
default.php
description.txt
license-readme.txt
thumbnail.png
typography.css
view.php

I tried duplicating the view.php from the Imagine theme and it did give me the members area but the page was a mess so I deleted it and now have just a blank default page.
Steevb replied on at Permalink Reply
Steevb
HI,

Try - concrete/single_pages
sniggitysnax replied on at Permalink Reply
sniggitysnax
What is the URL of your site?
Jdial replied on at Permalink Reply
Jdial
http://www.nailglamz.com
sniggitysnax replied on at Permalink Reply
sniggitysnax
So you are wanting to display the user's image and name where exactly? Give me a specific page or idea of where you're thinking of displaying these.
Jdial replied on at Permalink Reply
Jdial
Basically a community page like concrete5's own. On nailglams.com/members of my site.

If you would like I will change the theme back to the one that has the working members page. Return and look now if you will.
sniggitysnax replied on at Permalink Reply
sniggitysnax
Okay, navigate into /concrete/single_pages and copy the members.php into the single_pages folder in your root directory. Next go into /config/site_theme_paths.php and
$v = View::getInstance();
$v->setThemeByPath('/members', "your theme name here");

This will override the concrete member's page.
Jdial replied on at Permalink Reply
Jdial
Now we are getting somewhere! So after doing all this to the letter nothing happened... But instead of going to
/config/site_theme_paths.php=(returned this back to normal)
then went to.
concrete/config/themes_paths.php
$v->setThemebypath('/members',VIEW_CORE_THEME);

only problem is it doesn't have any theme, but has both our member ID's and avatar. Also now when you click the name it goes to a blank profile page, no more edit options, but this is themed.

Really appreciate you coming back to help me on this.
sniggitysnax replied on at Permalink Reply
sniggitysnax
Okay, just to clarify, you did change the "your theme name here" to your theme's name right? EX:
$v = View::getInstance();
$v->setThemeByPath('/members', "Halloween");

Now, in the theme_paths.php, you should be able to set VIEW_CORE_THEME to "Halloween" or whatever your theme name is. All this is doing is applying your theme to that page type.
Jdial replied on at Permalink Best Answer Reply
Jdial
Yes but when I change the name to "Halloween" I get this message.

http://www.nailglamz.com/index.php/members/...

An unexpected error occurred.
File not found. All themes need default.php and view.php files in them. Consult concrete5 documentation on how to create these files.

"UPDATE"***************************************************************

Hopefully I can explain all this, maybe no one else cares lol.
Here we go,
None of the above worked unfortunately, still big ups to "Sniggity" would have never figured this out without you!
Conclusion: I had to create a file inside,
/packages/theme_halloween/themes/halloween
Name: View.php
Contents: /packages/theme_halloween/themes/halloween/default.php
after
<?php  $a = new Area('Main'); $a->display($c); ?>


/concrete/single_pages/members.php
Looks like this
<?php  $a = new Area('Main'); $a->display($c); ?>
<?php   defined('C5_EXECUTE') or die("Access Denied."); ?>
<div id="ccm-profile-wrapper">
   <form method="get" action="<?php  echo DIR_REL?>/<?php  echo DISPATCHER_FILENAME?>">
         <?php   echo t('Search');?>        
         <input type="hidden" name="cID" value="<?php  echo $c->getCollectionID()?>" />
         <input name="keywords" type="text" value="<?php  echo $keywords?>" size="20" />      
         <input name="submit" type="submit" value="<?php  echo t('Search')?>" />   
   </form>
   <h1><?php   echo t('Members');?></h1>    
   <?php   if ($userList->getTotal() == 0) { ?>
      <div><?php  echo t('No users found.')?></div>
   <?php   } else { ?>
      <div class="ccm-profile-member-list">
      <?php


Ya Buddy!
Jdial replied on at Permalink Reply
Jdial
I have public profiles enabled on my dashboard But when you register or login it takes you to...

Fatal error: Call to a member function getTotal() on a non-object in /hermes/bosweb/web201/b2019/ipg.nailglamz/packages/theme_halloween/themes/halloween/view.php on line 33

Any input would be greatly appreciated.