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 - zhono

Pages: [1] 2 3 4
1
If anyone runs into this issue, you are probably using 4.2.2

I was able to solve it by installing 4.2.0 instead. Luckily it was a new forum with no users or content, so I could just switch. If you already have content, I don't know what you can do. Maybe there is a way to downgrade? Hopefully someone will figure out how to fix the problem, so we can use 4.2.2(latest vB 4 version).

2
Pretty old thread at this point, but I'm getting and error. At first it was the error that came when the path to vBulletin was wrong. I fixed the path, but now I get a blank page with just this error:

Code: [Select]
Warning: require_once(./includes/functions_navigation.php) [function.require-once]: failed to open stream: No such file or directory in ....includes/functions.php on line 39
I've tried every possible way to write the path for vbulletin. I even changed it to the full absolute path on my server. Still the same error.

3
I'm not sure why that would happen. If you don't already have keywords, or don't mind them being removed, I can give you an altered version of the script that will overwrite the keywords with just the image width-height. It'll also skip the ones it already did each time, so you can get through them all.

I'll try to build a better solution soon.

4
Hello Szooguun,

I think all you would need to do is find:

Code: [Select]
$imgsize = @GetImageSize($root_path."/data/media/".$cat_id."/".$image_file);
And replace with:

Code: [Select]
$imgsize = @GetImageSize($root_path."/data/media/".$cat_id."/big/".$image_file);
If you have any trouble, let me know.

5
Actually, like I said, I have everything else working perfectly. It refreshes on login, and logout. If you login at facebook.com and then visit my site, it will also refresh and log you in. My only problem is that when you click the facebook logout button, it does refresh, but you are still logged into the site. I'll PM the link.

6
I'm back yet again. I've had everything working nicely, but just noticed another problem. If I'm logged in with facebook, and I click the facebook logout button, it will log me out from facebook, but not from the site. So since you're still logged in, you won't see the standard login link, but you also don't see the logout link either. If I login and out with standard login right from the start, it works fine.

7
Chit Chat / Re: Advice on my template...
« on: January 28, 2013, 08:32:03 AM »
Finally up! I've left out the stuff I'm still working on, like the forum and the friend system(might just use the existing one from here). But it's coming together.
Before now, no one was posting comments and such, so I'm linking to specific categories and images that I've filled out all the extras on, for demo purposes.

Main page:
http://anime-themes.net

Categories page(to try the "sort by color." I have to manually edit the image's colors in the AdminCP, and there are over 15,000 of them lol):
http://anime-themes.net/categories.php?cat_id=220

Details page (also demo comments):
http://anime-themes.net/details.php?image_id=13139

Member profile:
http://anime-themes.net/member.php?action=showprofile&user_id=1

I've also made a demo account so you can test out the lightbox drag and drop order, comments, visitor messages, see what options are available in the edit-profile page, and other user features. username: 4images   password: 4images

A big "thank you" to anyone who can check out the site, and post back here to tell me what you think, make suggestions, or report any bugs you might find while looking around.


*EDIT* And just like magic, things all over the site are broken, when they worked perfectly fine on my test server.

There, fixed. My tip of the day: Never comment your Javascript with     //My comment
Always use    /* My Comment */   or your site will break and it will take 3 hours to realize it was the stupid comments all along.

8
Willkommen im Forum!
...
Der Link verweist dann auf "meineseite/<a href" ......
Das Problem betriff nur "links" und wenn du damit so wie du ein Bild verlinken möchtest, ansonsten wäre dein vorgehen richtig.
Damit das ganze jetzt auch mit dem verlinkten Bild funktioniert:
suche in der member.php:

        $site_template
->register_vars($additional_field_array);
      }

und füge darunter ein:

      $site_template
->register_vars("user_facebook", (!empty($user_row['user_facebook'])) ? "".format_text($user_row['user_facebook'], 2)."":"");


mfg Andi


Hi. I'm having the same problem as stillman. I followed your instructions (I think. Google translate isn't very good sometimes), and I'm still having trouble. The link is still broken, and the information doesn't appear in the field in edit-profile any more, even though it's still in the database.

I tried:

*DELETED previous bad code*

Didn't work either. Any ideas what I can do to get links working in additional fields?

*EDIT* Nevermind. I was editing in the wrong place. It's working now. I used this code:
Code: [Select]
$user_job_link = (isset($user_row['user_job_link'])) ? format_text(format_url($user_row['user_job_link']), 2) : REPLACE_EMPTY;
      if (!empty($user_job_link)) {
     $site_template->register_vars(array(
   "user_job_link" => $user_job_link
 ));

9
This is a very simple one. This will allow you to search images by size.

First, use phpmyadmin or similar to run this SQL. Be sure to change 4images_ to your prefix if you used something else.
Code: [Select]
ALTER TABLE `4images_images` ADD `image_width` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
ADD `image_height` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'

Then in /admin/plugins create an empty file called set_sizes.php and paste inside:
Code: [Select]
<?php
/* Created By Zhono */
$root_path = (false === stristr($_SERVER['PHP_SELF'], "/plugins/")) ? "./../" "./../../";
define('ROOT_PATH'$root_path);

include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');

$site_db = new Db($db_host$db_user$db_password$db_name) OR die("HAHAHAHAHA! You Fail At Life!");



$sql "SELECT image_id, cat_id, image_name, image_media_file, image_keywords, image_width, image_height 
        FROM "
.IMAGES_TABLE.
        WHERE image_width = '0'
        OR image_height = '0'"
;

$result $site_db->query($sql);

if(
mysql_num_rows($result)!=0){

$worknum 0;

while (
$row $site_db->fetch_array($result)){
  
$image_id $row['image_id'];
  
$image_name $row['image_name'];
  
$cat_id $row['cat_id'];
  
$image_file $row['image_media_file'];
  
$image_keywords $row['image_keywords'];
  
$worknum $worknum 1;
  
  
$imgsize = @GetImageSize($root_path."/data/media/".$cat_id."/".$image_file);
  
$imgwidth $imgsize[0];
  
$imgheight $imgsize[1];
  
$image_width $imgwidth;
  
$image_height $imgheight;
  
  if (
$image_width == '' || $image_height == '') {
  echo "There was a problem checking the image file dimension.";
  exit;
  }
  
  if (
$image_keywords == '') {
  $image_keywords $image_width."x".$image_height; //You can edit these to include
  
} else {
  $image_keywords $image_keywords.",".$image_width."x".$image_height; //other keywords if you want
  
}
  
  echo 
$worknum.".<br>\n";
  echo 
"<a href=\"/details.php?image_id=".$image_id."\" target=\"_blank\">Image ID: ".$image_id."</a><br>\n";
  echo 
"Image Name: ".$image_name."<br>\n";
  echo 
"Filename: ".$image_file."<br>\n";
  echo 
"Real Size: ".$imgwidth."x".$imgheight."<br>\n";
  echo 
"Set Size: ".$image_width."x".$image_height."<br>\n";
  echo 
"Keywords Set To: ".$image_keywords."<br><hr>\n";
  
  
$sql "UPDATE ".IMAGES_TABLE." SET image_width = '$image_width', image_height='$image_height', image_keywords='$image_keywords' WHERE image_id = '$image_id'";
  
$result mysql_query($sql) OR die("HAHAHAHAHA! You Fail At Life!");
  
  }

  @
mysql_close($site_db);
} else {
echo "All images sizes are currently set.";
@mysql_close($site_db);
}

?>

Also you might want to open db_field_definitions.php and add:
Code: [Select]
$additional_image_fields['image_width'] = array('Width');
$additional_image_fields['image_height'] = array('Height');

Now you can edit width and height in the admin panel.

Now just go to your AdminCP and click set_sizes.php in the plugin section. It will get the width and height of the image file and set each one in the database.
It will also add WIDTHxHEIGHT(such as 1024x768) as a keyword. It checks to make sure it doesn't delete the keywords you already have, too. You will want to run this plugin whenever there are new images added to the gallery.

After that, just run the "Rebuild Search Index" plugin that comes with 4images. Now try it! Go to your gallery search page and type in a size as a keyword. You can type just one like "768" or the whole thing "1024x768". The new width and height values are also very useful in other mods and for building various templates.

That's it for this one, enjoy. Also, watch for a few other simple admin tools that I'll be posting. Maybe I'll just add them to this thread, instead of making a thread for each one.

10
Chit Chat / Re: Advice on my template...
« on: January 25, 2013, 02:35:41 PM »
It's looking awesome. but release is going to take longer than I thought. Decided to build my own forum add-on for 4images. Also have to build a custom member profile shoutbox, since the existing one doesn't work with 1.7.11

Also wondering about a feature, if anyone thinks it's a good idea. I'm thinking about having revenue sharing on my site. If a user uploads image, he can also enter his adsense ID in his control panel. On the details page for his images, the ad would use his ID for, maybe 10% of the time(every 10th image hit). So he gets a chance to make money on adsense from his own images. And if he buys a VIP/donation membership on my site, his ads would be used more often, like 50% or even 100% of the time.

I've also setup a Mature setting for images, so if a mod tags an image as mature, google ads are not shown on that image details page. I've already have my site banned from Adsense because there were some pictures that they said violated the adsense terms. Just got my site unbanned and don't want to kill it again. lol

11
I wasn't sure if 4images had an easy way to do this already, and I needed it, so I set this up on my site.

includes/functions.php

Find
Code: [Select]
?>
Replace
Code: [Select]
function browser_info($agent=null) {
  // Declare known browsers to look for
  $known = array('msie', 'firefox', 'chrome', 'safari', 'webkit', 'opera', 'netscape',
    'konqueror', 'gecko');

  // Clean up agent and build regex that matches phrases for known browsers
  // (e.g. "Firefox/2.0" or "MSIE 6.0" (This only matches the major and minor
  // version numbers.  E.g. "2.0.0.6" is parsed as simply "2.0"
  $agent = strtolower($agent ? $agent : $_SERVER['HTTP_USER_AGENT']);
  $pattern = '#(?<browser>' . join('|', $known) .
    ')[/ ]+(?<version>[0-9]+(?:\.[0-9]+)?)#';

  // Find all phrases (or return empty array if none found)
  if (!preg_match_all($pattern, $agent, $matches)) return array();

  // Since some UAs have more than one phrase (e.g Firefox has a Gecko phrase,
  // Opera 7,8 have a MSIE phrase), use the last one found (the right-most one
  // in the UA).  That's usually the most correct.
  $i = count($matches['browser'])-1;
  return array($matches['browser'][$i] => $matches['version'][$i]);
}

?>

includes/page_header.php

Find
Code: [Select]
?>
Replace
Code: [Select]
$ua = browser_info();

if ($ua['firefox']) {
$doctype = "";
} else {
$doctype = "<!DOCTYPE HTML>";
}

if ($ua['msie']) {
$msie = 1;
} else {
$msie = 0;
}

$site_template->register_vars(array(
"doctype" => $doctype,
"msie" => $msie
)
);

?>

Now use the example to create your own. The examples allow you to display a different DOCTYPE for Firefox using {doctype},
or you can show some html to Internet Explorer users only, by using {if msie} ...my html... {endif msie}

Other check types:

Replace firefox with a browser that we setup in the $known = array
Code: [Select]
if ($ua['firefox']) ... // true
if ($ua['firefox'] > 3) ... // true
if ($ua['firefox'] > 4) ... // false
if ($ua['browser'] == 'firefox') ... // true
if ($ua['version'] > 3.5) ... // true

Very simple, I know. But very useful. It saved my site from being broken in some browsers by letting me change the doctype, and displaying a message to IE users to get a better browser.

12
Chit Chat / Re: Advice on my template...
« on: January 20, 2013, 02:58:51 PM »
I'm reviving this thread, because I will be releasing the newest version of my site soon, and I would like suggestions before I upload my new version.

I've built a completely new template, added many mods from users here, and created many of my own mods. Almost every core file has been edited for this. Here a list of what my new version has so far.

Entire site properly skinned with dark and light versions, 8 color various for each version, and 13 background styles. User can easily select which appearance he likes best.
Complete Facebook integration, thanks to budduke
Jquery show categories based on the first letter, animated
Jquery sort wallpapers on category page by color, animated
Reply to comments, and threaded comments
User avatars, thanks to v@no
If user has Facebbok connected, he can choose to use his Facebook profile image as his avatar instead.
Use favorites/lightbox as a screensaver, with full settings panel. My own mod, not the old KurtW version
Edit the order of images in favorites/lightbox(also changes the screensaver order). I hope to make it drag and drop soon.
Fancy user profiles, like on social media sites. Shows users latest comments, uploads, favorites, visitor messages, and more.
User can click button to make all his profile items editable, right on his profile page(a.k.a. inline editing or wysiwyg editing)
Admin can click button on details page to edit all fields directly on the page, no need to go to the admin panel.
Search images by resolution/dimension, color, and more.
Ticket system(I forget who made it) to allow users to report images/users, to apply for ad space, or become affiliates
Various other things that I can't remember right now.


I'm also working on a custom news system. I don't like the ones available in the forums.

So my question is, does anyone have any other suggestions? I want to do as much as I can before I release the new version to my users. You can take a look at the current version of the site for ideas, but just remember that much of what you see there has already been rebuilt, and will look very different when I'm done.

13
Thanks for the reply.

I've tried your quote mod, but it doesn't do what I'm looking for. I don't actually need to quote the comment, but when I reply to a comment, I want the entire comment to be show under the comment that was replied to, instead of at the bottom. Is there a way I can make your mod do that? Your mod doesn't change anything in the database, and I'm pretty sure there would need to be something to mark a comment as regular or reply, so it can be rendered differently.

Of course I'm probably wrong, and I just don't understand how to make it work.

*EDIT* Basically, I'm rebuilding my template. My HTML for the comments section looks like in the attached image. I'm trying to figure out how to get the comments to render out in that way.


*EDIT2* Nevermind. Took a while, but I managed to code it myself, using your mod as an example. Mods, feel free to delete this thread.

14
Is there a mod out there to do this? I'd like for a user to be able to hit a "Reply" button on any comment, to respond to it. The new comment would then appear under the first one as a response.

So it would be kind of like this:

-Mike
-Good photo.

-Joe
-Love this image
----Lisa
----Thanks, it's mine.
--------Joe
--------Well, good job then.

-Jay
-*troll* *troll* *troll*

-Jay
-I hate this image, it's ugly!

15
Well, this is embarrassing. It seems I missed step 8.c

So that's why it wasn't logging in the new user after he enters his password.

It still doesn't redirect the user, but just has to click a link and he's logged in. I'll figure out the redirect later I guess. My solution above still works nicely for redirecting existing users after login, though, so I'm leaving it in place.

If I figure out why new users don't redirect after registration, I'll post my solution. Thanks for the help. Now I'm off to redesign my template.

Also, my fb_login_url_z only tells the Facebook script where to send the user after a successful login. Which is why I sent it to the current page. It doesn't actually change the handling of the login itself.


*EDIT*

Fixed the redirect by opening register.php and changing all of the:

Code: [Select]
//MOD facebook
      if ($fb_flag>1){ $msg=$lang['fb_register_success'];}
       $site_sess->set_session_var("fb_flag", 0);
      $fb_flag=0;
      //END MOD facebok

To:

Code: [Select]
//MOD facebook
      if ($fb_flag>1){ $msg=$lang['fb_register_success'];}
       $site_sess->set_session_var("fb_flag", 0);
      $fb_flag=0;
     redirect($site_sess->url("index.php"));
      //END MOD facebok

Now when the user submits his password, he goes right to the home page, completely logged in and ready to go. My new template will contain slideout message to new users, so he will know it was a successful registration when he sees that. No need for the regular success page.

Pages: [1] 2 3 4