Google+

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Avatar default
#1
as dori ca noi membri sa aiba avatar de cand se inregistreaza si dupa daca doreste sa il modifice cum doresc
#2
(11-15-2010, 08:14 PM)Zeusake Wrote: as dori ca noi membri sa aiba avatar de cand se inregistreaza si dupa daca doreste sa il modifice cum doresc
Salut!
Pentru Default Avatar la înregistrare poţi folosi acest plugin...
Datele de mai jos trebuie salvate într-un fişier "defaultavasig" cu extensia .php. După aceasta trebuie să plasezi fişierul în directorul plugins din inc.
Mai jos ai codul :

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/*  
    Default Avatar/Signature Plugin
    By DennisTT & Surdeanu Mihai
    Version 1.1.1
*/
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("member_do_register_process", "defaultavasig_register");

function defaultavasig_info()
{
	return array(
		"name"			=> "Default Avatar and Signature",
		"description"	=> "Gives new users who register a default avatar and signature.",
		"website"		=> "http://www.dennistt.net",
		"author"		=> "DennisTT & Surdeanu Mihai",
		"authorsite"	=> "http://www.dennistt.net",
		"version"		=> "1.1.1",
		"guid" 			=> "",
		"compatibility" => "1*"
	);
}

function defaultavasig_activate()
{
	global $db;
	$info = defaultavasig_info();
	$db->query("INSERT INTO ".TABLE_PREFIX."settinggroups (name,description,isdefault) VALUES ('$info[name] (DennisTT)', 'Settings for the $info[name] plugin', 'no')");
	$group = $db->insert_id();
	
	$db->query("INSERT INTO ".TABLE_PREFIX."settings (name,title,description,optionscode,value,gid,disporder) VALUES ('defaultavasig_avatar', 'Default Avatar URL', 
'The URL to the default avatar (eg. images/avatars/php.gif or http://anothersite.com/someimage.gif)', 'text', 
'./images/avatars/php.gif', $group, 1)");
	$db->query("INSERT INTO ".TABLE_PREFIX."settings (name,title,description,optionscode,value,gid,disporder) VALUES ('defaultavasig_signature', 'Default Signature', 
'This will be the user\'s default signature.<br /><br />The following codes will be replaced:<br />{username} - username<br />{website} - user\'s website<br />{regdate} 
- Registration date<br />{bbname} - Board name',
 'textarea', '{username}, proud to be a member of {bbname} since {regdate}.', $group, 1)");
	rebuild_settings();
}

function defaultavasig_deactivate()
{
	global $db;
	$info = defaultavasig_info();
	$result = $db->query("SELECT gid FROM ".TABLE_PREFIX."settinggroups WHERE name = '$info[name] (DennisTT)' LIMIT 1");
	$group = $db->fetch_array($result);
	
	if(!empty($group['gid']))
	{
		$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE gid = $group[gid] LIMIT 1");
		$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE gid = $group[gid]");
		rebuild_settings();
	}
}

function defaultavasig_register()
{
	global $newuser, $mybb;
	if(!empty($mybb->settings['defaultavasig_avatar']))
	{
		$newuser['avatar'] = addslashes($mybb->settings['defaultavasig_avatar']);
		$newuser['avatartype'] = 'remote';
	}
	if(!empty($mybb->settings['defaultavasig_signature']))
	{
		global $username, $website;
		$default_signature = $mybb->settings['defaultavasig_signature'];
		$default_signature = str_replace("{username}", $username, $default_signature);
		$default_signature = str_replace("{website}", $website, $default_signature);
		$default_signature = str_replace("{regdate}", date($mybb->settings['regdateformat'], time()), $default_signature);
		$default_signature = str_replace("{bbname}", $mybb->settings['bbname'], $default_signature);
		$newuser['signature'] = addslashes($default_signature);
	}
}
?>

PS : Codul nu este testat! Dacă nu mere vino cu un reply!

Users : collective term for those who use computers. Users are divided into three types : novice, intermediate and expert.
Novice users : people who are afraid that simply pressing a key might break their computer.
Intermediate users : people who don`t know how to fix their computer after they`ve just pressed a key that broke it.
Expert users : people who break other people`s computers.
#3
http://img59.imageshack.us/img59/9177/sc...002ejq.jpg

asa arata in board setings Smile desi am reusit instalarea lui
#4
Incearca si plugin-ul asta: http://rapidshare.com/files/431152379/de...rofile.php

Il incarci in inc/plugins si il activezi, apoi modifici setarile.
Bafta !
#5
tot acelasi rezultat


Forum Jump:


Users browsing this thread: 1 Guest(s)