Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Template error Failed to find block 'my_profile'  (Read 8966 times)

0 Members and 1 Guest are viewing this topic.

balkan

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Template error Failed to find block 'my_profile'
« on: November 22, 2007, 03:57:59 pm »

i get error when guest visit the gallery, if visit registered users working perfect because i used bridge menager (PHP-Fusion), so i find this answer:
Code: [Select]
define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);to:
Code: [Select]
define('USER_CAN_CREATE_ALBUMS', USER_ID ? (int)$USER_DATA['can_create_albums'] : 0);
in this topic: http://forum.coppermine-gallery.net/index.php?topic=23433.msg107807#msg107807

if i used this code not show me (Upload Pictures), and you cannot upload picture, if i do not use this code i get error when visit guest gallery, for members working, i need help !!!
« Last Edit: November 24, 2007, 12:41:26 am by Nibbler »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Template error Failed to find block 'my_profile'
« Reply #1 on: November 23, 2007, 08:07:31 am »

i get error when guest visit the gallery,
What error

i used bridge menager (PHP-Fusion)
PHP-fusion bridge goes unsupported.


if i used this code not show me (Upload Pictures), and you cannot upload picture, if i do not use this code i get error when visit guest gallery, for members working, i need help !!!
I have no idea what you mean. Do you have an error message for guests in the first place? If yes, then you have a brdging issue and should do as suggested in the sticky thread of the bridging board. If you have issues with uploading, then you should do as suggested in the upload troubleshooting section of the docs.
Definitely doesn't belong into the theming board. I'll move your thread to the proper board, depending on your answer to my above question.
Logged

balkan

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Template error Failed to find block 'my_profile'
« Reply #2 on: November 23, 2007, 01:58:48 pm »

this is error when guest visit the gallery:
Code: [Select]
Template error
Failed to find block 'my_profile'(#(<!-- BEGIN my_profile -->)(.*?)(<!-- END my_profile -->)#s) in :

            <!-- BEGIN home -->
        <a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a> ::
  <!-- END home -->  <!-- BEGIN my_gallery -->
        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> ::
  <!-- END my_gallery -->  <!-- BEGIN allow_memberlist -->
        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a> ::
  <!-- END allow_memberlist -->        <!-- BEGIN upload_pic -->
        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a> ::
  <!-- END upload_pic -->  <!-- BEGIN register -->
        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a> ::
  <!-- END register -->  <!-- BEGIN faq -->
        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> ::
  <!-- END faq -->  <!-- BEGIN login -->
        <a href="{LOGIN_TGT}" title="{LOGIN_TITLE}">{LOGIN_LNK}</a>
  <!-- END login --> 
i used caliSkinV6 Theme, so i have tested whit sample theme and another but its same ...

code of bridge is:
fusion.inc.php
Code: [Select]
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2005 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR

This program is free software; you can redistribute it and/or modify/meinewebsite/config.php
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.
**********************************************/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Switch that allows overriding the bridge manager with hard-coded values
define('USE_BRIDGEMGR'0);

require_once 
'bridge/udb_base.inc.php';

class 
fusion_cpg_udb extends core_udb {

function 
fusion_cpg_udb()
{
global 
$BRIDGE;

//if (!USE_BRIDGEMGR) { // the vars that are used when bridgemgr is disabled

// URL of your fusion
$this->boardurl 'http://www.labunista.info/';

// local path to your fusion config file
require_once('../config.php');

//}

$this->multigroups 0;
$this->group_overrride 1;
$this->use_post_based_groups 1;

// Database connection settings
$this->db = array(
'name' => $db_name,
'host' => $db_host,
'user' => $db_user,
'password' => $db_pass,
'prefix' => $db_prefix
);

// Board table names
$this->table = array(
'users' => 'users',
'groups' => 'user_groups',
);

// Derived full table names
$this->usertable '`' $this->db['name'] . '`.' $this->db['prefix'] . $this->table['users'];
$this->groupstable '`' $this->db['name'] . '`.' $this->db['prefix'] . $this->table['groups'];

// Table field names
$this->field = array(
'username' => 'user_name'// name of 'username' field in users table
'user_id' => 'user_id'// name of 'id' field in users table
'password' => 'user_password'// name of 'password' field in users table
'email' => 'user_email'// name of 'email' field in users table
'regdate' => 'user_joined'// name of 'registered' field in users table
'active' => "''"// is user account active?
'lastvisit' => 'user_lastvisit'// name of 'location' field in users table
'location' => 'user_location'// name of 'location' field in users table
'website' => 'user_web'// name of 'website' field in users table
'usertbl_group_id' => 'user_level'// name of 'group id' field in users table
'grouptbl_group_id' => 'group_id'// name of 'group id' field in groups table
'grouptbl_group_name' => 'group_name' // name of 'group name' field in groups table
);

// Pages to redirect to
$this->page = array(
'register' => '/register.php',
'editusers' => '/members.php',
'edituserprofile' => "/profile.php?clen="
);

// Group ids
$this->admingroups = array(102,103);
$this->guestgroup 100;

// Connect to db
$this->connect();
}

// definition of how to extract an id and password hash from a cookie
function cookie_extraction()
{
$id 0;
$pass '';

if (isset(
$_COOKIE['fusion_user'])){
$cookie_vars explode("."$_COOKIE['fusion_user']);
$id is_numeric($cookie_vars['0']) ? $cookie_vars['0'] : "0";
$pass = (preg_match("/^[0-9a-z]{32}$/"$cookie_vars['1']) ? $cookie_vars['1'] : "");
}

return (
$id) ? array($id$pass) : false;
}

function 
authenticate()
{
global 
$USER_DATA;

if (!
$auth $this->cookie_extraction()) {
$this->load_guest_data();
} else {
list (
$id$cookie_pass) = $auth;
$f $this->field;

$sql "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['usertbl_group_id']} AS group_id ".
"FROM {$this->usertable} AS u WHERE u.{$f['user_id']}='$id'";

$result cpg_db_query($sql$this->link_id);

if (
mysql_num_rows($result)){

$row mysql_fetch_assoc($result);

mysql_free_result($result);

$db_pass $this->udb_hash_db($row['password']);
if (
$db_pass === $cookie_pass) {
$this->load_user_data($row);
} else {
$this->load_guest_data();
}
} else {
$this->load_guest_data();
}
}

$user_group_set '(' implode(','$USER_DATA['groups']) . ')';

$USER_DATA array_merge($USER_DATA$this->get_user_data($USER_DATA['groups'][0], $USER_DATA['groups'], $this->guestgroup));

$USER_DATA['has_admin_access'] = (in_array($USER_DATA['groups'][0],$this->admingroups)) ? 0;

$USER_DATA['can_see_all_albums'] = $USER_DATA['has_admin_access'];

// avoids a template error
if (!$USER_DATA['user_id']) $USER_DATA['can_create_albums'] = 1;

// For error checking
$CONFIG['TABLE_USERS'] = '**ERROR**';

define('USER_ID'$USER_DATA['user_id']);
define('USER_NAME'addslashes($USER_DATA['user_name']));
define('USER_GROUP'$USER_DATA['group_name']);
define('USER_GROUP_SET'$user_group_set);
define('USER_IS_ADMIN'$USER_DATA['has_admin_access']);
define('USER_CAN_SEND_ECARDS', (int)$USER_DATA['can_send_ecards']);
define('USER_CAN_RATE_PICTURES', (int)$USER_DATA['can_rate_pictures']);
define('USER_CAN_POST_COMMENTS', (int)$USER_DATA['can_post_comments']);
define('USER_CAN_UPLOAD_PICTURES', (int)$USER_DATA['can_upload_pictures']);
define('USER_CAN_CREATE_ALBUMS', (int)$USER_DATA['can_create_albums']);
define('USER_UPLOAD_FORM', (int)$USER_DATA['upload_form_config']);
define('CUSTOMIZE_UPLOAD_FORM', (int)$USER_DATA['custom_user_upload']);
define('NUM_FILE_BOXES', (int)$USER_DATA['num_file_upload']);
define('NUM_URI_BOXES', (int)$USER_DATA['num_URI_upload']);

$this->session_update();
}

function 
collect_groups()
{

$udb_groups = array(103 =>'Super Administrators'102=> 'Administrators'101=>'Members'100=> 'Guests');

return 
$udb_groups;

}

// definition of actions required to convert a password from user database form to cookie form
function udb_hash_db($password)
{
return 
$password;
}

// Login
function login_page()
{
$this->redirect('/login.php');
}

// Logout
function logout_page()
{
$this->redirect('/setuser.php?logout=yes');
}
}

// and go !
$cpg_udb = new fusion_cpg_udb;
?>


so many functions not show to admins and registered users, like Upload Picture, Album Create ...

this is code to show me if i manuel upload picture:
upload.php
Code: [Select]
You don't have permission to perform this operation.

File: /home/xxx/galerija/upload.php - Line: 38
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Template error Failed to find block 'my_profile'
« Reply #3 on: November 23, 2007, 04:06:43 pm »

Then do exactly as suggested in the sticky thread on the bridging board where I moved your thread to.
Logged

balkan

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Template error Failed to find block 'my_profile'
« Reply #4 on: November 23, 2007, 05:01:24 pm »

i visit sticky thread and not help me   :-[
my bridge code working, but not show more functions like upload pictures, sorting albums and others ....
i pasted my code and where i wrong ?
Logged

balkan

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Template error Failed to find block 'my_profile'
« Reply #5 on: November 24, 2007, 12:37:34 am »

i Slooved my problem now,
so i need help how to admin apporved new uploaded picture because when upload member picture show in whiout admin approval ?
Logged

Nibbler

  • Guest
Re: Template error Failed to find block 'my_profile'
« Reply #6 on: November 24, 2007, 12:41:11 am »

Set that on the groups page. 1 question per thread please.
Logged
Pages: [1]   Go Up
 

Page created in 0.131 seconds with 19 queries.