4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Xwall on April 16, 2003, 06:20:01 PM

Title: [MOD-Request] Upload link in user_logininfo.html
Post by: Xwall on April 16, 2003, 06:20:01 PM
I need an upload link in user_logininfo.html.  :wink:
Upload Images

Must change member_uploadform.html adding a category_dropdown_upload.html where members can select the correct category to upload their images.

 :arrow: But only must show categories for registered members, not all ( admins galleries ).

Thanks.
Title: [MOD-Request] Upload link in user_logininfo.html
Post by: Xwall on April 24, 2003, 10:46:01 PM
Nobody can help me doing this MOD ?   :(

I believe that it can be useful for many in the forum  :?
Title: [MOD-Request] Upload link in user_logininfo.html
Post by: Apollo13 on April 24, 2003, 11:21:33 PM
well i have such a thing running on my site. But at the moment i'm working on my site. But if i found the code i'll post it....
Title: [MOD-Request] Upload link in user_logininfo.html
Post by: V@no on April 25, 2003, 12:16:47 AM
well, first I think u'll need copy part started with if ($action == "uploadimage") { ... } from member.php to page_header.php
second, how do u want handle when image was uploaded? do u want kick user from the page he was on to "details" of new image page? 8O
how about error handling? with all this it will be hard to make correct clickstream if something went wrong so user could easily come back to the page he was on before.
maybe it would easier for users have dropdown menu for avalable categories and after chosing one it would open upload page?
Title: [MOD-Request] Upload link in user_logininfo.html
Post by: Xwall on April 25, 2003, 11:39:47 AM
An example (you must register until) in http://www.deviantart.com/submit/  :?

I don´t invent anything only I say what already I have seen  :oops:
Title: Bild Upload
Post by: Xwall on April 29, 2003, 11:53:04 AM
Cr@zy Sash,

Quote from: Cr@zy Sash
well i have such a thing running on my site. But at the moment i'm working on my site. But if i found the code i'll post it....

You can post the code please...

http://crazy-pics.de.vu/
Service / Uload / Bild Upload / Kategorie (category_dropdown)  :D
Title: [MOD-Request] Upload link in user_logininfo.html
Post by: Apollo13 on April 29, 2003, 12:02:12 PM
well i do this manually. But i think there must be a function 2 read out all categories. Well I try 2 do something and than i post it ok...
Title: Re: Bild Upload
Post by: V@no on April 29, 2003, 12:56:23 PM
Quote from: Xwall
Service / Uload / Bild Upload / Kategorie (category_dropdown)  :D

this can be done just pointing to member.php?action=uploadform
category dropdown will be generated from all avalable categoryes with upload permission.
Title: Al final
Post by: Xwall on April 30, 2003, 05:32:10 PM
Bueno lo que he hecho es una chapuza pero que se la va hacer  :lol:

Well i do this manually like Cr@zy Sash.  :(

This is a doubt no is a manual to make it.

A doubt to do it better
in includes/page_header.php i add after "url_upload"

Code: [Select]
"url_upload1" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform1"),

To make works this in member.php i must find

Code: [Select]
if ($action == "uploadform") {
.
.
.
  $content = $site_template->parse_template("member_uploadform");
}


and paste after

Code: [Select]
if ($action == "uploadform1") {
.
.
.
  $content = $site_template->parse_template("member_uploadform1");
}


I think this badly done but works well , suggestions???
of course member_uploadform1 is member_uploadform1.html (new template)
This template must have sometihig like this:
 
 
Code: [Select]
<select name="cat_id" style="background-color: #CCCCCC; font-size: 11px;" id="cat_id">
                    <option value="15" class="row3">Arte Digital - 3D</option>
                    <option value="16" class="row3">Arte Digital - Abstracto</option>
                    <option value="161" class="row3">Arte Digital - Erótico</option>
                    <option value="26" class="row3">Arte Digital - Estilo Libre</option>
                    <option value="18" class="row3">Arte Digital - Luminoso</option>
                  </select>


<select name="cat_id" id="cat_id"> is the key, because in member_uploadform.html (id="cat_id") is a hidden field.

Excuses for my poor english  :oops:
Title: [MOD-Request] Upload link in user_logininfo.html
Post by: V@no on April 30, 2003, 06:13:22 PM
I think it should be if ($action == "uploadform") {

U dont have to do it manualy.
first off all, if u allowed upload only for register users (none of the categories has permission for guests), u can use this:
Code: [Select]
function get_category_dropdown_upload() {
  global $lang, $drop_down_cat_cache, $cat_parent_cache;
  $category = "\n<select name=\"cat_id\" class=\"categoryselect\">\n";
  $category .= "<option value=\"0\">".$lang['select_category']."</option>\n";
  $category .= "<option value=\"0\">-------------------------------</option>\n";

  $drop_down_cat_cache = array();
  $drop_down_cat_cache = $cat_parent_cache;
  $category .= get_category_dropdown_bits_upload(0);
  $category .= "</select>\n";
  return $category;
}
function get_category_dropdown_bits_upload($cat_id = 0, $cid = 0, $depth = 1) {
  global $site_db, $drop_down_cat_cache, $cat_cache;

  if (!isset($drop_down_cat_cache[$cid])) {
    return "";
  }
  $category_list = "";
  foreach ($drop_down_cat_cache[$cid] as $key => $category_id) {
    if (check_permission("auth_upload", $category_id)) {
      $category_list .= "<option value=\"".$category_id."\"";
      if ($cat_id == $category_id) {
        $category_list .= " selected=\"selected\"";
      }
      if ($cat_cache[$category_id]['cat_parent_id'] == 0) {
        $category_list .= " class=\"dropdownmarker\"";
      }

      if ($depth > 1) {
        $category_list .= ">".str_repeat("--", $depth - 1)." ".$cat_cache[$category_id]['cat_name']."</option>\n";
      }
      else {
        $category_list .= ">".$cat_cache[$category_id]['cat_name']."</option>\n";
      }
      $category_list .= get_category_dropdown_bits_upload($cat_id, $category_id, $depth + 1);
    }
  }
  unset($drop_down_cat_cache[$cid]);
  return $category_list;
}

then, register it in the template:
Code: [Select]
"cat_dropdown" => get_category_dropdown_upload(),
then in the template u can use {cat_dropdown}
I havent test it ;)
Title: Re: [MOD-Request] Upload link in user_logininfo.html
Post by: neverkas on July 24, 2009, 12:10:14 AM
Thank you V@no it works very well..!
I want to ask you a question.

I want that the menu of the selection to disappear
http://www.fullposteo.com.ar/member.php?action=uploadform&cat_id=7

I want that the menu of the selection to appear (display)
http://www.fullposteo.com.ar/member.php?action=uploadform
Title: Re: [MOD-Request] Upload link in user_logininfo.html
Post by: V@no on July 24, 2009, 03:17:32 AM
Apparently I just answered to you in another post:
Mod? Help :) (http://www.4homepages.de/forum/index.php?topic=25386.0;topicseen)
Title: Re: [MOD-Request] Upload link in user_logininfo.html
Post by: CorFie on October 16, 2009, 08:42:04 AM
Sorry for question:

Can you give it in a complett mod?
cause I like to get something like this to, but I've got problems with the realization.

What I have to do first and what then?