The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
This is an HTML example. Isn't it just wonderful?!?!
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2008, 04:51 AM
h2ojunkie h2ojunkie is offline
Junior Member
 
Join Date: Oct 2006
Posts: 25
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default Users name to post as "Guest"

How hard would it be to add support to allow the Users name to post as field to be Guest or userid 0?

I tried the following, but it just ended up posting the article under the userid I was logged in as

Code:
		    if ($this->settings['ugs_able_to_post_as_other_users'])
		    {
                		if (is_member_of($this->vb->userinfo, $this->settings['ugs_able_to_post_as_other_users']))
                		{
               			if ($this->vb->GPC['GARS_post_as'])
                			{
if ($this->vb->GPC['GARS_post_as'] == "Guest") { $postasid = 0; }
else {
                        		$result = $this->db->query_first("SELECT userid FROM " . TABLE_PREFIX . "user WHERE
							username ='" . $this->db->escape_string($this->vb->GPC['GARS_post_as']) . "'
						");

                        		if (!$result['userid'])
                        		{
                                		$errors[] = construct_phrase($this->vbphrase['GARS_err_no_user'],$this->vb->GPC['GARS_post_as']);
                        		}
                        		else
                        		{
                                		$postasid = intval($result['userid']);
                        		}
                			}
}
                		}
		    }
Reply With Quote
  #2  
Old 12-05-2008, 05:23 PM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Not sure, haven't done it, but you might run into a problem as guests have userid of zero and do not have an entry in the vB user table. You'd probably need to change more than that code, i.e., look for post_as_id for other locations in the code.
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #3  
Old 12-06-2008, 07:32 PM
h2ojunkie h2ojunkie is offline
Junior Member
 
Join Date: Oct 2006
Posts: 25
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default

I tried your suggestions and made a couple more edits to gars_class_core.php with no luck there either

Code:
                                        $data = unserialize($result['data']);
                                        if ($data['post_as_id'])
                                        {
if ($data['post_as_id'] == 0) {
$username = "Unregistered";
} else {
                                                $username = $this->db->query_first("SELECT username FROM " . TABLE_PREFIX . "user
									WHERE userid = " . intval($data['post_as_id'])
								);
}
                                        }

It appears to be saving the data to gars>data:
Code:
a:5:{s:7:"post_as";s:12:"Unregistered";s:10:"post_as_id";i:0;s:6:"gal_id";N;s:12:"gal_keywords";s:0:"";s:8:"gal_text";s:0:"";}
But not so lucky with the thread and post tables.

Any suggestions for what I might be missing?


P.S. I changed to using "Unregistered" instead of "Guest"
Reply With Quote
  #4  
Old 12-07-2008, 02:51 AM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

The GARS post as another user feature was coded with the assumption that the other user is a member and not a guest. The are two ways that I see ATM to post as a guest. One is to sift through the code and make the necessary changes. As I haven't done this, the only way to really approach it would be to go through all the code and see what needs to be changed and where. The other way would be to create another member account and post under that user name, and then use a template conditional to change what gets displayed in the postbit based on the userid of the "guest" user account.
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #5  
Old 12-07-2008, 03:11 AM
h2ojunkie h2ojunkie is offline
Junior Member
 
Join Date: Oct 2006
Posts: 25
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default

Quote:
Originally Posted by Morgan View Post
The other way would be to create another member account and post under that user name, and then use a template conditional to change what gets displayed in the postbit based on the userid of the "guest" user account.
Hey!..that's a good idea. I'll do that.

Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick trick for "Post Thank You Hack" & "Passive video" hack cclaerhout Geek Article and Review System 2 08-13-2009 06:36 PM
dont can sort "last post" hohleweg Geek Article and Review System 1 09-01-2008 12:01 AM
Pssible erro: "Users Left -1" AyeCapn Geek Gazette 5 06-15-2007 06:31 PM
fehler "kein benuzername.." error "username" hohleweg Geek Article and Review System 7 03-22-2007 11:28 PM
Remove "Post As User" option trana Geek Article and Review System 3 02-23-2007 09:13 AM


All times are GMT. The time now is 09:22 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.