| Topic: | HELP: advprofile + photoshare mainpic as user pic |
|---|---|
|
whiskey
Noob
Posts: 5 Posted: |
I have tried a lot of things but none of them seem to work (maybe because i don't know much about php and pnrender)... anyways... here is a thing i tried... i hacked the ns_newuser module to create a new photoshare gallery for each new user... the main pic should be used as advprofile pic... in user menu (so the image remains there) i added after line 7 in advprofile_user_menu.tpl: now ... what am i doing wrong? has anybody tried something like this? what is wrong with my syntax? How would you get the data needed? it's just one tiny little number sitting there and i cannot get it to work jajaja help or comments appreciated |
|
Chestnut
Site Admin Posts: 1320 Posted: |
Eww........ My first suggestion would be to drop that code...... Then, look at the advProfile/pntemplates/plugins... Use the available code (take a plugin, rename it and adapt it) to get the your main image name (shouldn't there be a WHERE ??)... (Do not use mysql_query, use the available $dbconn-> ....) If you study the plugins right, at the end, all you'll have to put in the template is something like this : And your image will show if you did your plugin right. :wink: Chestnut ! ![]() Site Admin |
|
whiskey
Noob
Posts: 5 Posted: |
dont know where is the WHERE (lol)... maybe got lost somewhere... thanks.. i will do and when its done i will post it somewhere here (for others to help me get it working right lol) see ya... gotta lot to do with this |
|
whiskey
Noob
Posts: 5 Posted: |
Ok, here is what i tried But i get no output using or in the advprofile_user_menu.tpl :cry: What am i doing wrong? I used pncuserpoints.php function as a base for the function. Thanks in advance! edited but still not working |
|
Chestnut
Site Admin Posts: 1320 Posted: |
Use the code tag please. And you had no sql Error ? There is one : That should help getting nearer... This part is useless : Unless you use a template... Be careful also if there is more than one file for this owner... If more than one file, then $mainpic will be an array and will output "Array" or nothing. Chestnut ! ![]() Site Admin |
|
whiskey
Noob
Posts: 5 Posted: |
At last it worked thanks... here its the code: Now, you can see that i had to call the tables by their names... well i didn't found a way for them to work properly calling them: and i do not why but this works. Now for the other part of the hack... i will post later because we have to make sure every new user has a unique album. see ya |
|
whiskey
Noob
Posts: 5 Posted: |
Note that the previous plugin will work when you create a photoshare album for each new user (yes, previous users will require you to create them an album) go to user.php from ns_newuser and somewhere insert this: below this: which is somewhere around line 440 - 442 This code creates a new sql entry for your user into photoshare folders after they create their entry, it uses the book template as default, you can change to any other template you want. Also uses the nuke preffix and the photoshare standard name so keep that in mind. Now this takes care for new users, but not for existing ones... i will see how to fix this (maybe a php script to read your existing users and create them new albums? i dont know), and if you create the user manually via admin, such user will not have (yet) a new album. Easy, just go and create one yourself for him/her. (yes as soon as i find how i will post the hack for this). Next we should take care about a couple of things... for example, as chestnut points out, if multiple albums are generated (sub albums), multiple main pictures will be defined for each user and multiple outputs will generate an array... Maybe we can make it select just main folders ( adding to the WHERE in the query something like AND ps_parentfolder = -1. Also we will want to make sure that photoshare will not create a new folder with the same number as a new user... (this hack is also in the TODO bin), maybe creating manually a folder with a really really large number (so new users get the lower numbers and sub folders will autoincrement from lets say 123456789 and forth XD ), but until i try it i will not recommend it. Now for my website i do not need multiple albums per user (yet), so there will be no "create new album" function (nor delete function)... any new hack needed i will post here. Thanks for the help! |
|
MACscr
Plumber
Posts: 147 Posted: |
Any update on this hack? I would also love to see a working version of it. |