Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - universal

Pages: 1 2 3 [4] 5 6 7 8 ... 10
46
Mods & Plugins (Releases & Support) / Re: [MOD] Ban v1.6
« on: May 19, 2005, 10:04:54 AM »
This is my functions.php ... http://www.pramoga.net/includes/functions.php.txt
Maybe if it is not dificult, you can say if there is any bugs? (as they really is)

47
Mods & Plugins (Releases & Support) / Re: [MOD] Ban v1.6
« on: May 19, 2005, 07:43:02 AM »
what do you mean i`ve something changed?
I`ve nothing changed for your mod...

48
Mods & Plugins (Releases & Support) / Re: [MOD] Ban v1.6
« on: May 19, 2005, 05:15:31 AM »
I have changed false to true
Code: [Select]
else
  {
    $ip = $site_sess->session_info['session_ip'];
    $email = $user_info['user_email'];
    $user_id = $user_info['user_id'];
    $name = $user_info['user_name'];
    $hostname = "";
    $force = true;
  }


But now
Quote
Warning: main(./includes/functions.php): failed to open stream: No such file or directory in /home/pramoga/public_html/global.php on line 266

Warning: main(./includes/functions.php): failed to open stream: No such file or directory in /home/pramoga/public_html/global.php on line 266

Warning: main(): Failed opening './includes/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/pramoga/public_html/global.php on line 266

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 99

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 107

Fatal error: Call to undefined function: check_ban() in /home/pramoga/public_html/includes/sessions.php on line 412

49
If it is not dificult to you
comment line
Code: [Select]
header("Location: ".$url.""); //setting header location to index page and write a line after
Code: [Select]
echo $i,"<br>";
echo $all_url;

its strange... and i cant say what happened so i need to view these variables.

50
Mods & Plugins (Releases & Support) / Re: [MOD] Ban v1.6
« on: May 18, 2005, 03:57:20 PM »
Here you go :)
http://www.pramoga.net

Added ban for IP: 65.35.35.*

51
can you give me a link?

52
Mods & Plugins (Releases & Support) / Re: [MOD] Ban v1.6
« on: May 18, 2005, 09:22:53 AM »
OK, i`ve installed succefully, no error apeared during installation. BUT there is one BUT :)
Script doesnt work. Or i cant understand how it works.
So I add a ban on my host or on my ip but I still can login page, I tryied to login and logout but still nothing happened.
Is there something wrong or what? :)

53
This code shows your browser to go to the homepage
Code: [Select]
else //if no name was given
{
header("Location: ".$url.""); //setting header location to index page
}

This code is active only when this code is true

Code: [Select]
if (($i != "") and ($i != "guest")) //if url is with name and it`s not guest
if no name was given or name was "guest"

54
A little corection if somebody uses this plugin :)
A bug when user name contains spaces,
So add this code

Code: [Select]
$i = str_replace(array("%20"), " ", $i);
after this line

Code: [Select]
$i = $i[4]; // when I get array of symbols, I take fourth symbol (it depends on url)
more symbols can be added for replacing, by editing this array("%20","symbol","symbol","symbol")

55
version 1.1

Everything what is needed is:
config.php - from 4images
.htaccess file (must be in folder where who.php will be)
who.php (you can name it how you want)

now no test needed, just set your url and try it. I`ve tested it only on my server.
will work only with this link http://your_url/who/user name
not with http://your_url/who/user name/


.htaccess

Code: [Select]
<files *>
Options MultiViews
</files>

who.php

Code: [Select]
<?
// Settings
///////////////////////////////////////////

$url = "http://www.pramoga.net";
$table = "4images_users"; //do not edit if you have not changed table prefix

// Code
///////////////////////////////////////////

include "config.php";
$a_url = $_SERVER["REQUEST_URI"];
$i = explode("/", $a_url);
$b = count($i);
$b = $b-1;
$i = str_replace(array("%20"), " ", $i[$b]);
if (($i != "") and ($i != "guest"))
{
$db = mysql_connect("$db_host", "$db_user", "$db_password") or die ("Error");
@mysql_select_db("$db_name", $db) or die ("DB not found");
$result = mysql_query("SELECT user_id FROM `$table` WHERE user_name='$i'");
$row = mysql_fetch_array($result);
$id = $row['user_id'];
header("Location: ".$url."/member.php?action=showprofile&user_id=".$id."");
}
else
{
header("Location: ".$url."");
}
?>


version 1

Just a little script that I made for my site :)
A personal addres for users, to profile.

DEMO: http://www.pramoga.net/who/admin/ (admin is user name, existing in 4images gallery)

So, first I want to explain how it works :)
"who" is not a folder, it`s originaly a script called who.php, to use this script without extension .php you will need to put .htaccess file into the folder where who.php is. The code of .htaccess is:

Code: [Select]
<files *>
Options MultiViews
</files>

So the first thing is done :)
Second is very important for script who.php and it depends on your url, how many slashes "/" there is. I made a little test to find out what number for variables you will need.

test.php
Code: [Select]
<?
$url = "http://www.pramoga.net"; //your url
$url_extender = $_SERVER["REQUEST_URI"];
$all_url = $url.$url_extender;
print_r(explode("/", $all_url));
?>

Change url in this script and go to it like that
http://www.pramoga.net/test/admin (can be another user name)
or
http://www.pramoga.net/test.php/admin (can be another user name)

DEMO: http://www.pramoga.net/test/admin
We need a number of user name, So we take it from here
Array (
  • => http: [1] => [2] => www.pramoga.net [3] => test.php [4] => admin )
    The number is 4

    We can go to final step :)

    Script who.php
    Code: [Select]
    <?
    /////////////////////////////////////////////
    // Originaly made for http://www.pramoga.net
    // If you made any modifications, feel free
    // to contact with me and share your code ;)
    /////////////////////////////////////////////

    $url = "http://www.pramoga.net";

    /////////////////////////////////////////////
    include "config.php";
    $url_extender = $_SERVER["REQUEST_URI"]; // gets url end
    $all_url = $url.$url_extender; // i dont know why, but i make all url...
    $i = explode("/", $all_url); // then I delete all slashes
    $i = $i[4]; // when I get array of symbols, I take fourth symbol (it depends on url)
    $i = str_replace(array("%20"), " ", $i); // replaces %20 with simple space " "
    if (($i != "") and ($i != "guest")) //if url is with name and it`s not guest
    {
    $db = mysql_connect("$db_host", "$db_user", "$db_password") or die ("Error"); // connecting to db
    @mysql_select_db("$db_name", $db) or die ("DB not found"); // selecting db
    $result = mysql_query("SELECT user_id FROM `4images_users` WHERE user_name='$i'"); //querying mysql, and selecting users id from db
    $row = mysql_fetch_array($result);
    $id = $row['user_id']; //selected id seting to variable $id
    //finally
    header("Location: ".$url."/member.php?action=showprofile&user_id=".$id.""); //setting header location to members profile
    }
    else //if no name was given
    {
    header("Location: ".$url.""); //setting header location to index page
    }
    // thats all :)
    ?>

    Find
    Code: [Select]
    $i[4]; and change 4 to your number, that you find in test.php :)

    It`s explained step by step, so it`s very simple :)
    Upload it to the server and try :)

56
Just try to edit the code below this, I don`t want to edit for my site (as I have only one copy and it`s in public :lol: ):
Code: [Select]
//-----------------------------------------------------
//--- Show Profile ------------------------------------
//-----------------------------------------------------
if ($action == "showprofile") {

Btw this not the only code I think, that is needed to change...

Good luck ;)

57
Did you mean something like that?
Demo: http://www.pramoga.net/who/admin/

58
Also, to show hostname for guests:
Find:
Code: [Select]
echo "<td>".$row['session_ip']."</td>\n";
Add this below
Code: [Select]
echo "<td>".gethostbyaddr($row['session_ip'])."</td>\n";
Btw, i had modified this "echo "<td>".gethostbyaddr($row['session_ip'])."</td>\n";"

And now I can do whois lookup for guest to, just replace it with:
Code: [Select]
echo "<td><a href=\"".$ip_whois_link.$row['session_ip']."\" target=\"_blank\">".$row['session_ip']."</a></td>\n";

59
Mods & Plugins (Releases & Support) / Re: [MOD] Last comments v1
« on: May 10, 2005, 03:09:57 PM »
V@no,
Maybe possible to ask you, to show how to do some modifications?
If we put a admin links in these comments? :)

60
Mods & Plugins (Releases & Support) / Re: [MOD] Last comments v1
« on: May 10, 2005, 01:21:01 PM »
{last_comments}
</tr> this you can delete :)

btw greate mod ;) waiting for part 2 :)

Pages: 1 2 3 [4] 5 6 7 8 ... 10