Title: Twitter Tools Plugin Multiple forms help
Last modified: August 19, 2016

---

# Twitter Tools Plugin Multiple forms help

 *  [plaidfox](https://wordpress.org/support/users/plaidfox/)
 * (@plaidfox)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/twitter-tools-plugin-multiple-forms-help/)
 * Alright, I’ll try to explain this as best I can.
 * I have a client who wants users to be able to visit 3 pages. On each of these
   pages there needs to be a different form, each asking a specific question that
   users can answer to.
 * Right now, I’m using Twitter Tools, and through alot of trial and error, I’ve
   figured out how to adjust the php so that a different form shows up on each page.
   The users can successfully post to each form and have what they posted show up
   on twitter. The problem is adding the hash tags. I’d like to add a specific hash
   tag to the end of each answer depending on which question they responded to. 
   I’ve figured out how to add a generic hash tag around this part of the code:
 *     ```
       case 'aktt_post_tweet_sidebar':
       if (!empty($_POST['aktt_tweet_text']) && current_user_can('publish_posts')) {
       	$tweet = new aktt_tweet();
       	$tweet->tw_text = stripslashes($_POST['aktt_tweet_text']);
       	$tweet->tw_text .= ' #sm6b21';
       	if ($aktt->do_tweet($tweet)) {
       		die(__('Tweet posted.', 'twitter-tools'));
       	}
       	else {
       		die(__('Tweet post failed.', 'twitter-tools'));
       		}
       	}
       break;
       ```
   
 * However, figuring out a way to bring a variable in here so I can do something
   like:
 * `$tweet->tw_text .= ' #sm6b2'.$variable;`
 * Any suggestions? Or are you all really confused at this point?

Viewing 1 replies (of 1 total)

 *  [atlohi](https://wordpress.org/support/users/atlohi/)
 * (@atlohi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/twitter-tools-plugin-multiple-forms-help/#post-1119971)
 * I’ve just (finally) gotten Twitter Tools to append the Facebook hashtag used 
   by a Facebook app called Twitter Selective Status. The application pulls Twitter
   status updates into Facebook as long as they are appended by the #fb hashtag.
   The time it took me isn’t the fault of Twitter Tools; it was more my stunning
   lack of knowledge of php. My goal was to integrate the status updates on my web
   site, Twitter and my business Facebook page.
 * What I did was to change the format of the tweet on this line from this:
    $this-
   >tweet_format = $this->tweet_prefix.’: %s %s’;
 * to this:
    $this->tweet_format = $this->tweet_prefix.’: %s %s %s’;
 * with the last %s place holder being there for the hashtag.
 * Then I set up a variable for the hashtag and placed it right before the tweet
   was written out for a new post to my site. In my version of Twitter Tools, this
   starts on line 467, after $url is assigned it’s value.
    Here’s the code:
 * $fb_hashtag = ” “.chr(35).”fb”;
    $tweet->tw_text = sprintf(__($this->tweet_format,‘
   twitter-tools’), $post->post_title, $url, $fb_hashtag);
 * Since # is a comment character, I used the chr() to get it into the hashtag variable.
 * My website is [http://www.weavinginbeauty.com](http://www.weavinginbeauty.com).
   I hope this helps you!

Viewing 1 replies (of 1 total)

The topic ‘Twitter Tools Plugin Multiple forms help’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [atlohi](https://wordpress.org/support/users/atlohi/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/twitter-tools-plugin-multiple-forms-help/#post-1119971)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
