|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
3 O& q+ e: g5 Q! p// Theme Option
1 [- w* v8 C1 r3 ~) x////////////////////////////////////////////////////////////////////////////////
' H+ e& _8 R6 y# L0 q" M/ A- \, h. J- x2 M) P
$themename = "Zenx";
: H* f9 x; F! ?: e1 `0 `1 W8 d$shortname = str_replace(' ', '_', strtolower($themename));/ A6 D# u/ Q% j( W$ K
( Q* z; c) e" N0 rfunction get_theme_option($option)
3 L- j7 @+ e6 [! ]{
# y5 `6 t: q- ?, {* | global $shortname;
! `' d3 e9 x5 e X+ M# \ return stripslashes(get_option($shortname . '_' . $option));4 r# c: M3 x) j( P" ~+ F d
}/ m( {- ^/ W* n5 h2 v4 O5 P: s
+ D: E+ h$ R( H* x3 V6 S
function get_theme_settings($option)
4 Q( ^6 `/ E! W6 A5 H# z+ f$ f{
. H0 C: w: ~; G$ q return stripslashes(get_option($option));
9 D& s _+ c+ A% }3 @- z}
/ E/ K1 d( U' }6 E6 \3 P$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
- _7 ~$ n# w1 i" A* T+ H6 j$wp_getcat = array();
% J* F2 d2 s7 N1 B6 gforeach ($wp_dropdown_rd_admin as $category_list) {
f9 u3 ^% e ? A- \+ g" K$wp_getcat[$category_list->term_id] = $category_list->name;) z5 [/ N, j9 Z0 G! c7 i
}/ M2 E h" ]# B
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
+ x2 v; B8 X& B) a$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
! ?3 o; c. P7 c0 ~# s7 c$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
4 l- I: n U; Q( b/ p2 U
( o( [' q* F0 s! d) s9 G j! |' r0 {$options = array (
, x/ W8 m9 w/ J/ n/ H+ r! k; p* v$ ^$ [. q
$ N6 p, q/ b: H* z7 A& A; t; ~ array( "name" => "Blog Header Settings"," J4 T+ m) N: S& i5 _
"type" => "heading",
' i( J& f( _0 }) V6 F3 |. \ ),
- h5 G8 V* [# c `6 A8 P5 y" K' G( B3 w/ s( r% H
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ ?7 y1 l% D, E: Z9 [7 {
"id" => $shortname."_header_logo_activate",
5 M: ?3 `' E+ F% U% e. b0 S "type" => "select",' Q6 c' ~5 l- U5 k
"std" => "No",+ c$ L: b+ A x
"options" => array("No", "Yes")),
5 W) m) Q% }, {. d0 x+ \, X# }# [. ~" z3 W( w
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
0 B" [7 g" x V2 S "id" => $shortname."_logo_url"," n& h: [- x1 }
"type" => "text",
& o) b$ C! D Y( z6 U. ?( i: X "box" => "social",3 |7 u- \& S& s0 X% g# _' U' c
"std" => "",- X5 a6 Z. M, A% ^/ t
),2 k- i* Z% [$ b- t2 l% N; I
; ? w) K+ F" f7 y, I array( "name" => "Insert Header Banner HTML Code (Header)
; z( E1 c0 P; s6 Z9 N <br /><em>*Recommended Size 468 x 60</em>' J3 p; F% [+ N. o
<br /><em>*leave blank if not use</em>",
$ R+ g" H, ?8 B "id" => $shortname."_header_banner",+ v" o3 ^) M/ B! ^6 R- G
"type" => "textarea",
# \, A7 O" ^" d# e) ]" b6 K "std" => "",
1 P2 J) y6 q! S ),
2 Q8 O- |6 i I
) h4 A0 J: D7 }, w2 y array( "name" => "</div></div>",
- I, l0 R6 q H2 [- D6 S4 Y: \ "type" => "close",2 K0 r. @( [2 z1 B. b
),
# N& b, M$ j) m6 n. B- Q% g( o6 `. M5 V Z0 E
6 Q! o5 K1 c2 l1 Z array( "name" => "Header Navigation Settings",8 g# n, n+ P0 G) n4 H
"type" => "heading",
5 M) K6 i( ]% ?0 G$ h ),
4 s0 V) L* x: C4 f7 ]
8 r- q2 F/ f- [, p! x1 H2 B; P array( "name" => "Insert Page ID To Exclude On Header Navigation<br />% U! s G! V2 c4 G8 y4 x% W7 B
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
3 f/ c% }/ z# G9 d* c( p$ a0 S <em>*Enter the page post ID number only</em><br />/ k) L. q+ R/ x6 {. c/ I3 T6 P9 Y' x/ ?
<em>*separate by comma</em><br />
3 i( S+ J. ^) _& F, |. C2 M/ u <em>*Exclude pages which you don't want to show on the header navigation</em>",
5 a' j, |3 y" p* ]& P3 L3 H "id" => $shortname."_header_page_navigation",2 K X* T# k( L7 H
"type" => "text"," t% n# ]& m: g1 ^7 o
"std" => "",
1 L# v% \* p$ E# Q9 S ),* a% i, H' Z! M! f
& y$ {6 J% S* X1 {* P0 P0 Z z2 V array( "name" => "</div></div>",
7 | j$ K& c% e% ]* _ "type" => "close",4 h3 {5 d' C8 @+ j
),, o) d) j# A9 j) X4 g
9 M* c) F+ l6 e0 ]+ e$ p# |3 A0 w' F; E6 r- Y' A
array( "name" => "Post Auto Thumbnails Settings",
# D9 t5 j$ m+ y6 h' {8 @, n: i/ f "type" => "heading",3 M8 i [, v/ Q' W# Z# O& l5 w* s
),
1 t1 S+ p& Q, K( d& I" A * B( s* E" j6 |8 c" X/ x( x: l& Z
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 r, V$ S, L+ o1 Z# C "id" => $shortname."_timthumb_activate",* ?6 h O$ ^9 o( m' z
"type" => "select",3 z8 s+ B: p4 |: F
"std" => "No",
. o. j) d" f1 ~! p' Y" h+ g, Z% d2 f9 L "options" => array("No", "Yes")),
0 D8 ~/ f: I. s 4 g2 O9 G7 O" F1 k2 g2 N
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
( W1 T u! W8 q. c& g- c5 c "id" => $shortname."_timthumb_cropping",! M7 w7 D/ m& h+ R7 R8 {1 Y
"type" => "select",
/ T/ J0 T+ ?6 `0 a7 _1 ^* I "std" => "",
8 h: m4 A- C( b" s n; V8 @7 _9 f, r "options" => $crop_position),
s! u7 e9 s% ]3 o" V( h' Z
) N1 k& q4 D/ A: u1 i: I2 @ array( "name" => "Insert Width Of Thumbnail Image<br />
# h+ J! Q: ]) H) f, y3 T <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
) @: Z, t9 F. h6 i3 i/ c <em>*Leave Blank To Use Default: 250</em><br />",- b B# Y' ` W
"id" => $shortname."_thumb_width",
; g8 D3 G+ Z2 k6 V1 T5 L "type" => "text",
0 s& K" E4 |% {/ o. d( | "std" => "",
6 u) S4 [* a: q/ V; f, q* \9 ] ),8 p9 {% [8 n8 g( _# d$ I# _
6 f8 H2 U |- o
array( "name" => "Insert Height Of Thumbnail Image<br />
; C4 n3 w- C: l0 F" Y <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
. [: u3 g$ f7 c7 a: k) J- h <em>*Leave Blank To Use Default: 200</em><br />",
& E% b# n4 i$ L6 s. V; [& U "id" => $shortname."_thumb_height",
7 G+ U+ D& o! y- O" w9 }4 q "type" => "text",
- Y# u! R. U) Q+ c1 A "std" => "",
* D6 W, C6 V9 e* L- Z ),
- ~* H$ S3 f' l; H# i# G# y: v- g, {6 S, ^
* M( l" T B d5 H0 X& x6 I6 S array( "name" => "</div></div>",* y* X+ u9 r) u: P* [/ s
"type" => "close",
9 s" n1 F1 b( a# T6 j, Q8 L/ b: h ),
! G: v' H4 [$ D y
/ T! J: ]8 w. b$ Q3 z array( "name" => "Featured Content Slider Settings",
2 s D4 Y v. A, l3 i& f "type" => "heading",& z) L+ C9 O3 f( o3 t; K
),
- r4 m) B1 R' w& E8 z1 S- B6 p
; d# D1 z, u* }& B array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* a0 E H& y5 x. G5 V "id" => $shortname."_featured_activate",
) m7 e6 u; f c9 o "type" => "select",/ h3 h% ?/ H- f
"std" => "No",
. G0 j* p/ ] V' S; Z" o "options" => array("No", "Yes")),
% y9 w% _3 B, I% z9 @% U9 k3 X2 J2 U
/ T& V2 Y3 F5 m array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",' T3 G$ s) O& a7 W6 e; K
"id" => $shortname."_featured_category",
- v) {( P( |# r0 x) c6 q "type" => "select",
5 g, a c, j/ a2 j1 U "std" => "Choose a category:",
9 W* R6 \( a Z+ l "options" => $wp_getcat),0 L9 M/ _' w; B
; A# F2 D0 J9 q! j, L
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",- Y: k2 o" Y! f% s
"id" => $shortname."_featured_number",0 @9 _. y& I; ]. U0 r
"type" => "select",1 H, k* H4 ], O" w5 Z
"std" => "Number of post:",
/ I7 P( g- w ?% D$ r+ Y "options" => $number_entries),8 D" ^5 x0 w" {
# y6 s. j! o9 \2 N
array( "name" => "</div></div>",
) T' X# [) [1 Z9 ~0 v" T "type" => "close",3 c7 D+ n! ^: [" f6 p
),- q4 V6 \9 N. o) V
8 {9 S3 t6 [1 B% q! L* X5 w5 g2 w array( "name" => "Featured Category Settings",9 p2 y' d. K$ ~( f# L9 f+ F
"type" => "heading",) R0 Z( ?3 R2 Y1 A6 f+ O
),
2 Z2 X$ e( ]! j
3 \$ t( R$ [6 r' I" L; z array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 u" n! f" W5 i. f/ m7 D
"id" => $shortname."_featured_category_activate",' K4 E& O. L' e3 O. R
"type" => "select",
# \0 _" o8 V/ u' W" y9 N "std" => "No",' w! D2 w L: S* w: k
"options" => array("No", "Yes")),7 T' ^$ }1 N* {( S$ ?" v
T7 F; m& Z2 k6 A$ b array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
$ h2 E- l) Y8 ?4 P, i "id" => $shortname."_featured_category_id1",
# K# x1 h' T0 b0 O% [ "type" => "select",, B; P. { |5 S' O
"std" => "Choose a category:",
* O L# O' b6 R6 q3 o7 |/ R9 Y "options" => $wp_getcat),
/ t9 h% v: C# r* x0 @ + O' C r9 A% X& C
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
4 y/ q4 [9 @( a; @. O2 D5 I6 i, o "id" => $shortname."_featured_number1",
+ Q# l' Y5 t+ T% E "type" => "select",
& B U4 \3 ?) V3 {$ X u "std" => "Number of post:",
$ @ V$ `9 j) `4 j, A( ]$ g C1 J "options" => $number_entries),6 x( U3 n6 C( ^& m f# z
% C. z6 S: W7 H% C
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
; I6 q% R8 y# k. h, w "id" => $shortname."_featured_category_id2",7 Z* Y+ j0 m7 p3 K+ W! i. Q3 t
"type" => "select",6 V& S7 F# [& K! {% N" k
"std" => "Choose a category:",' T. b. V, b. i1 V8 y
"options" => $wp_getcat),
5 ]: [' L/ i; R( ]0 I2 _
% {4 O" N' m! z0 c! y array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",5 |* j! z! w+ W# F8 T8 c. A5 K
"id" => $shortname."_featured_number2",( E" A9 K1 G8 g/ m
"type" => "select",
. h" o# w* _) W, V# K1 M "std" => "Number of post:",
$ S* t4 ?: k: w% ^ "options" => $number_entries),1 K7 O, r+ Y& O8 r0 H# g
: h3 K7 u! i" K6 z. B. H; `+ w' Z
! o( U4 m% p: B0 c
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",$ k9 `: r& h% R7 U0 }2 O) A
"id" => $shortname."_featured_category_id3",2 }" ^( u" K! _% c% P
"type" => "select",
9 q0 p0 i) t" |6 G1 a2 {6 ?5 N "std" => "Choose a category:",
. `9 j3 n' [* f& f "options" => $wp_getcat),
* y" f( {6 e5 D1 U. T K 3 v- Z. d( x# V$ j! u9 q. c
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",; G) t# ^8 I3 C X* C3 U9 i
"id" => $shortname."_featured_number3",
6 Q' c9 s1 J& n) L& A "type" => "select",3 u9 W, ]3 G4 Q) j
"std" => "Number of post:",; q5 i0 v$ h4 {4 ~8 H; Y7 p
"options" => $number_entries),/ ?# B. x" ~1 m F* U' A% s
$ a% Q' K. e# |* @: V4 s* e3 }
. F/ x5 T7 c. [. a S
array( "name" => "</div></div>",/ Z+ G) `: `2 B- k! ~
"type" => "close",' S) C$ P/ f8 u
),
/ g9 @/ }" G& s* h" e2 r: F# ]7 d. G
+ Y" K2 s* U; i) r- X- c array( "name" => "Google Adsense & Analytics Settings",2 Q+ l+ ~# d( r& x
"type" => "heading",/ Q# B- w5 Q$ v1 A
),
: d c: i) A2 j) P! U
/ H& A" D; }3 p. m9 h array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
: f2 `4 h, V& D+ V0 X+ K A "id" => $shortname."_adsense_loop_activate",
/ Q5 G( D0 d/ d# i; Z! A "type" => "select",4 F4 Q5 \, u" g* q
"std" => "Disable",% |$ e* U7 T& Z4 A; g
"options" => array("Disable", "Enable")),
) P8 g/ ]3 R6 E, r3 W8 {+ ]; I$ {; u" P+ l; V
array( "name" => "Insert Google Adsense Code For Loops Here<br />9 ]0 s; J5 _8 `5 @8 i
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
0 ?9 e3 Q, b9 T# ~ "id" => $shortname."_adsense_loop",
: U! y! m7 x5 T+ P+ R1 s "type" => "textarea",
; U9 y; R+ F/ ?6 K7 B. A "std" => "",& l) ~1 K" i9 X7 C. j# P5 y
),2 e4 t! P w" [3 N, s7 w# B& s
4 S. k1 |) b8 I/ L0 E; Y9 B
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",9 P* f$ M1 S" G" q L% u6 S
"id" => $shortname."_adsense_single_activate",; @% `6 p4 j* L% `
"type" => "select",/ L+ U9 @) p' u/ N% c$ C+ z3 j
"std" => "Disable",; m/ V ?- K2 E# `
"options" => array("Disable", "Enable")),
. `8 ?4 l7 F% U$ {1 L9 }: w* O1 z
9 V) N! H) N# w* i2 R# i array( "name" => "Insert Google Adsense Code For Single Page Here<br />
}. }7 U, J, { <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
' o; U1 Z3 Z9 `8 P: _ "id" => $shortname."_adsense_single",
- a; g6 v8 m! k: Q& ` q "type" => "textarea",' j) W: U+ J) I5 q, g% N
"std" => ""," R4 ~9 e7 c( W/ e3 n
),% @& Z( [/ [5 S4 @6 _; ]6 d
2 a4 Z" v! g7 @4 }( y( Y/ L! s% W% W: I, e7 q# R* m- C& t* ]
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",3 j0 w0 K1 w2 O& V
"id" => $shortname."_google_analytics",/ w: k4 C ]3 n8 V* J2 p5 i* j( f$ f3 v
"type" => "textarea",
3 v4 O, }7 m9 @; g( l7 M$ a "std" => "",
# t" c3 h. F- {* u, d1 a) `( z ),
* z6 S' Z1 z' n! k3 M$ p0 k W$ }6 A5 n6 U. o
array( "name" => "</div></div>",
% G# T/ L5 [2 Z* z" t7 J7 X) @6 | "type" => "close",
. R6 Q9 X0 ]+ T' |5 m2 ^6 f ),6 }$ T3 a: b( i
6 P1 [; c! Z' x V7 S
) v' V& ?8 }) w! o4 U- E3 N- ^ array( "name" => "AddThis Social Bookmarking Settings",5 K( F4 G- E. T$ y- ]2 `
"type" => "heading",
1 d' P1 R9 X+ j4 t ),
- a- V( E0 R3 b/ U4 g
$ B H( R' o" C3 q0 s* _$ E1 S# A array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
0 j* x; H2 d9 b2 W <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",; v4 r1 E. f% B
"id" => $shortname."_addthis",! M: i, p9 T+ @
"type" => "text"," {. ?: t, x$ H+ E
"box" => "social",
% l: C- ^* T9 n1 n% L f t "std" => "",9 n; c8 \8 C# d" m% E2 B$ k
),- I7 A6 @. {( e: y* [
) X; ]# F$ M4 e" R% e: b5 C- p
array( "name" => "</div></div>",$ q7 F7 A6 O4 t9 `* Y
"type" => "close",
# _7 ?3 M1 v8 B- C) l/ j" O ),
5 Q# Y& o" v g/ J5 M& Z+ a7 Y3 t " Y# n% W$ A& ^! Y1 L& D5 _/ w- O+ G
9 t4 |- W8 d8 x1 c8 u( R& l
) D- G: k! e/ Z% V. i) r. L array( "name" => "YouTube Video Settings",0 @( u$ H3 R/ @
"type" => "heading",$ I( g# X& H* g8 f/ g
),1 A1 L1 F. e2 Q
$ V( n' j0 J q2 \; @' L- `. z array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; C# Y8 h3 T! z/ R6 a$ y
"id" => $shortname."_emvideo_activate",% M2 W! G% W( e
"type" => "select",( ^, O$ O, W d# F) Z
"std" => "No",1 K2 y: d+ ]4 S
"options" => array("No", "Yes")),( _4 ^2 g1 \8 j% ~" ]
$ o( [) y% y, C0 k7 B$ i6 H
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
& q" Y' Z9 ] z- g" T/ _ "id" => $shortname."_emvideo",3 a/ G' ^4 G. j6 U; O& {1 w
"std" => "",$ m4 [# b" [8 n2 E; j
"type" => "text"),0 u; V* c$ s* j( ~
0 j: X3 s) k, C4 F
array( "name" => "</div></div>",
7 M* v& `7 v" ^ "type" => "close",: z$ {* F I: ?6 @
),$ Z4 x, o/ i! {
! I' u- O/ [( {" v
array( "name" => "Twitter Settings",
* V; {' ~0 x9 Y! X: t "type" => "heading",
0 x+ }! u; e3 H5 _ ),
+ Y- W. O- [& r6 D* W" j# k0 s9 g1 H- `9 t7 y( D' |& o" v
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 E! T+ ~. }- G+ }2 C5 B' E7 z "id" => $shortname."_twitter_activate",
, ?6 J4 \& I8 Q- ` "type" => "select",
: K3 u: E4 u, Q: Q% _. Z "std" => "No",
, A1 y; @3 a* ^! r4 Q "options" => array("No", "Yes")),
% S5 s1 S6 v4 _* F+ Q _6 X6 z9 \& }* J0 k
array( "name" => "Insert Your Twitter ID here
a x% q) ~) k <br /><em>*leave blank if not necessary</em>
) A; p& J" W1 ?! C4 t! [ <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
2 z& ^; ~. E: y/ n9 R3 p "id" => $shortname."_twitter",
; M# v& k3 `/ c; K$ L( n- z/ e2 g "type" => "text",
/ G) O# o, A q Q6 c8 i "box" => "social",& c/ E& Q' T8 a" g
"std" => "",
: P, S9 m8 s+ b* m- |- u ),7 A8 k7 v" b8 g5 @ t
S# ]- M9 N8 z% A array( "name" => "Enter Twitter Feed Count here5 Q k" r# A, L. S* x
<br /><em>*leave blank if not necessary</em>% g8 d/ _$ P6 v$ r
<br /><em>*Enter How Many Twitter Feed To Display</em>",0 V! \( y. f7 a2 x! O" a8 F
"id" => $shortname."_twitter_count",
/ ?( O K8 z9 W2 W "type" => "text",- ?8 P" e: g& y1 g+ { w
"box" => "social",
1 ]" i4 k Y7 P8 r6 t "std" => "",. C% E2 L b0 y5 `9 u. U) ^7 l) F
),4 z7 I1 u/ E: O' z, [
/ i$ V8 u. s) `) s2 n' F, ^
array( "name" => "</div></div>",
$ A1 d( I. a: E' O "type" => "close",! B" n. x, G. R0 W6 X/ I
),
0 Z! z6 x1 j# g+ C4 w; D2 ^ 5 A, C! n0 J( `+ p3 K2 n9 L
& _ N3 L( ~7 B( _' o/ I$ x) r# j
array( "name" => "125 x 125 Banners Advertisement Settings",
$ d" {0 k3 P* M* g "type" => "heading",1 [) t! [% u, E: {; x
),
# X- ^7 _* S# Z9 ^& F/ g* z 0 W' q) R6 f. h
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ \) ~9 U# w6 ^" E% J4 [
"id" => $shortname."_sponsor_activate",
$ ^* h9 X, D- o7 R. J "type" => "select",
0 p1 }# c& P2 ?! R& @6 a, C, o "std" => "No",
) P1 a" X1 U. d7 v/ k9 l "options" => array("No", "Yes")),
9 F6 J$ l, U1 o4 T: ^( _
' g$ o! J0 ?2 e" u! b7 ^; [
% I X3 k; |# T0 N' ^ array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
$ V3 T& x# G# e5 l "id" => $shortname."_sponsor_banner_one",5 F- S% p! u" K1 q; _5 T
"type" => "textarea",
/ q1 J8 C W0 G% h9 f- ]* T "std" => "",
5 X* n" ?- x# {* s' U$ W8 t ), 4 |5 U9 x8 |- h! {% D& N
& @% O( r) P5 Y* X0 v% W array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
) s- u0 M6 }% R( w* C& C( [ "id" => $shortname."_sponsor_banner_two",0 P9 E _3 B& Y% f0 [
"type" => "textarea",
' {7 T! d9 A+ `0 c2 D1 n, k- B "std" => "",
+ q3 r o0 p2 n- N ),1 g; G$ d6 ]7 g4 o9 ]
- }8 p- v/ O7 A" a ]' V1 j array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",9 e- \ E" [ {2 ~9 g" e
"id" => $shortname."_sponsor_banner_three",3 x8 x, T! j5 I) L- M0 V
"type" => "textarea", f0 H! w- g7 i! Q; d: g+ v
"std" => "",% I* r; e8 d d- m/ q
),
2 ~7 r' m0 q2 S: l( h6 Z7 O; E
# g. o6 S+ c% N1 W2 {8 \' [/ u array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",/ E2 H! ~' K0 P. @6 P, `5 w
"id" => $shortname."_sponsor_banner_four",0 z. z! a a @2 L( Z
"type" => "textarea",! O! U$ e8 a' @) b3 {; {, s, x
"std" => "",
0 S! Q- O8 X$ e1 u' M* z )," }# F+ G2 u1 c% ~( _. \
6 s3 ^$ l% Y8 u4 k6 q0 |: t0 W
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",- ^; Q# X4 X' [' H/ }% T- O7 e
"id" => $shortname."_sponsor_banner_five",
5 Q* Q; a4 L* C* C- M: W "type" => "textarea",' ~6 {, O# x+ f2 P* ]
"std" => "",
9 \- G* Q! @% M2 X ),
# f, n) E `( Q3 \
) w: n- V H8 {* F array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",$ c% [; g+ S* i
"id" => $shortname."_sponsor_banner_six",4 a1 K2 `1 C& K3 y U
"type" => "textarea",
& X% O+ Y1 Z7 @ "std" => "",
4 T/ p/ T. M( w& V2 P" ]1 [ ),
1 M- C! M& X7 e; l" N, U$ L0 i
9 q0 m- Q; j& o array( "name" => "</div></div>",
& l& b5 Q+ R3 B2 f- w) n* F0 |- N "type" => "close",( J, \$ Y0 q( _+ b0 B
),& g8 b& i+ [ b) E& l) x# R
6 f. w9 \7 E0 E* y- A1 I" ^
- d$ f% a. O, i" M6 q9 ^2 C. W Z6 j
+ W" V+ S" s: R a" F- f);/ k) g8 J$ N9 S# A" o
, n% G# O! Y3 r8 s2 V, ~function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {7 j5 s) O3 J3 T
% O% h2 T+ Z) ^6 `( t7 F! @+ |* ~5 fecho "<div id=\"admin-options\"> "; U: }" E# J% I
# N7 f! f9 Q' h+ l' D8 [3 sglobal $themename, $shortname, $options;
" a/ ~+ T( P9 Z5 Wif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';. {9 W& D' s( C2 w& M
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
2 V' W3 h9 C) ?4 C?>
) y! V7 n4 Q; x2 {" f% f
, W; o# c( G' M7 i0 V# K<h4><?php echo "$themename"; ?> Theme Options</h4># b, Z0 }8 s4 k+ S5 M8 s8 o; e y
0 u: D5 _" s0 {! [6 n' z' m7 s3 X* u9 c
<div class="annouce">
0 F! v& ~& S! s$ n+ v" i8 y& o* E. b<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>; O: x2 E( m1 f) x' n
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
/ ]3 o: I7 v3 Y& R: m4 c" [</div>
+ X: t( F( I, F- v# x2 _! G8 Z& ^2 ?; x$ n! s
<form action="" method="post">
" B! X5 a: \# g3 u
% C4 Q$ c( I# [$ e* U+ `# G<?php foreach ($options as $value) { ?>0 [" e* @: c1 b) N4 j/ ~. G/ u
D/ i! p ~! {0 I; M* f7 P<?php switch ( $value['type'] ) { case 'heading': ?>' J! f7 Q4 {! M' ]) P, x: r
5 V/ x! H% S# ?8 \9 Z; ^4 Y: S& I! k8 Q<div class="get-option">
7 A: V: U5 S$ }. |
" q9 h1 M; _$ o" P* ^) a9 B6 B<h2><?php echo $value['name']; ?></h2>6 ^+ H" ?! T4 H4 z- w
! t. x5 t: O. K$ g, r6 E<div class="option-save">
+ w- n# X; H* e# e o! ~6 p0 z$ T7 S5 e! o" B" k
<?php
* U& J: T+ C2 J0 F: f, H( {break;
- F u. q$ @- u5 g3 X' ]* j8 U2 G1 Fcase 'text':
: r- G% q3 g) Y6 p: ~% a?>& t* ]8 C1 [. @; A+ I2 S; o; o
6 h, `& f k* E! f( v
<div class="description"><?php echo $value['name']; ?></div>: P1 M3 \- T5 [7 u; t7 B, f2 B
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (; f# {3 `: Y0 L7 }8 [3 W
: g A; \( C' M6 R( O, W1 s; Gget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>6 I+ g6 E G# }! u0 |1 W# Q3 _
% `, Z* l9 O$ e. d, E$ R
<?php
2 I' t- |5 _8 B4 h) w4 Nbreak;
* M$ f" o: Z7 Y6 }3 b5 S5 }$ ycase 'select':* O5 M% C: {( d# o% f+ D3 H" r
?>. E' A; t( O, C o
; w$ `0 C& @2 d, z5 Q<div class="description"><?php echo $value['name']; ?></div>3 G- `& @" W8 [' D. W
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">$ G3 [# A( |+ E4 y
<?php foreach ($value['options'] as $option) { ?>
8 o9 {6 Z7 h! X0 n: q<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>- S: Y1 N. Z/ `8 m: Q7 k
<?php } ?>
' c7 M( |! U+ u; W+ ]2 T- y2 A/ B</select>' C! m( e% i5 y2 d! W
</p>
+ [9 @+ p+ x% m+ W: E! a9 N& F) M2 Q! E
<?php
0 w8 G. R9 E+ r6 Vbreak;6 ~" v! K4 H; c
case 'textarea':& H8 [3 d- Q4 Q+ A/ E
$valuex = $value['id'];
6 U* V( |0 G1 M9 B0 T$valuey = stripslashes($valuex);
; x' u6 O2 J0 p' f$video_code = get_settings($valuey);0 f; c& ~5 T" O3 j0 B9 {
?>! v8 @- H+ x( O! ], o
2 Y+ V; k" Y. J* x% t) |6 f
<div class="description"><?php echo $value['name']; ?></div>
/ ~+ d! O; R$ `1 Q S* O<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }3 B0 l3 a9 {7 o5 X
, h7 I" E; G' k; n& h: V1 @7 Velse { echo $value['std']; } ?></textarea></p>
9 a3 K6 o0 Q6 O' J4 G: t
2 t2 z9 b! U0 G1 w5 f<?php, c5 j3 y- I/ {
break;
0 l3 L. n- ] a2 s- Hcase 'close':. y3 _8 |& S, Y+ X# C
?>
9 w+ S. ~; Z' O% Q" J0 A' @$ C
i* p8 F0 }. X- z; t$ q4 s9 e<div class="clearfix"></div>9 \& e$ ^0 Q2 y7 J" o
</div><!-- OPTION SAVE END -->+ L8 K" T! r% s* i0 {: v/ m2 o/ ]
3 v; V! p, e/ ?& E
<div class="clearfix"></div>
: f# @ t% C; B: j</div><!-- GET OPTION END --> R3 M+ |! O0 c- m1 ~) ^- E
$ t& t9 v3 t" q# x3 g<?php/ |4 D7 [6 K# \! {8 U5 c
break;# i# r$ _& ~) \: I# H7 N
default;
j1 N" S6 \+ p: d3 Q7 P: {; }?>0 D) j, h1 y8 n! }3 N* R7 g5 G
@7 i* W) A, g+ p( B& o
! I) Q! {: ]/ }# g
<?php
/ K) C; w& N- Zbreak; } ?>* G* I; ]/ @1 X, w/ `
. C. T: E0 m. {" a! \2 f
<?php } ?>
# t: T) {" k7 j1 A2 s
2 a& E) @& ^3 |# o O<p class="save-p">
! y$ F- j% P" \4 V1 b<input name="save" type="submit" class="sbutton" value="Save Options" />0 |; i, V3 j5 S T" F7 H# I2 x
<input type="hidden" name="action" value="save" />1 l7 X4 E+ V8 O3 Q4 d# Q$ U# Z' Z
</p>
& j+ q' u7 m4 M" G8 M. H</form>! ^) f" R! o5 I+ C; R
% Z2 `8 Z R% a( L6 N u4 @- i<form method="post">
" k. a6 p( T2 y<p class="save-p">
! }) c0 {$ U, [+ D9 ~- Y) A<input name="reset" type="submit" class="sbutton" value="Reset Options" />) X# X3 |% y( k4 b/ E0 K: K' i+ e
<input type="hidden" name="action" value="reset" />3 q7 p$ E$ a% ^ T, z5 G
</p>
' C- [& Y, W" ~4 ?- r, i</form>* G9 t5 ^. d1 B6 w2 c: i- j, K1 n
/ T9 h$ c x3 z</div><!-- ADMIN OPTIONS END -->& `, i3 ]& ]7 u/ J6 |, E1 k$ G
, Q2 I" X! o9 X4 Y2 A
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }8 _" `6 j2 E7 N; O4 m
; Q: ^! s& T+ ^
function mytheme_admin_register() {
, _; _, O& s' t4 n0 uglobal $themename, $shortname, $options;
. ], }4 p w8 y0 O8 d6 `if ( $_GET['page'] == basename(__FILE__) ) {
+ O8 K% \, h- uif ( 'save' == $_REQUEST['action'] ) {( s, |. e6 _6 h/ S) y9 U6 m1 n
foreach ($options as $value) {* o0 r9 o. L& G s& u3 A
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
8 |; P; Q3 b3 a' {, i% Yforeach ($options as $value) {
0 T9 P& a, A4 ?/ N) c$ p2 m+ v" Y/ ~if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
; }. E. b- _, h) s# mheader("Location: themes.php?page=functions.php&saved=true");
. C& W, H! r* E' |& d/ Xdie;
2 x/ m6 a: f) m& V' v5 L} else if( 'reset' == $_REQUEST['action'] ) {
- k/ K! H* C- aforeach ($options as $value) {
/ l! Y' ?$ U5 a5 B+ mdelete_option( $value['id'] ); }
* `( b" V2 v K( J- @& C( {header("Location: themes.php?page=functions.php&reset=true");4 w% C$ ~! j* j3 x5 }5 o v/ V
die;2 n! g8 C8 M* {/ t4 l5 u/ [/ a6 O
}8 M- w5 {5 \% b) d) X
}
" \* G0 a7 X- G0 u& @3 E) ^7 Jadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');2 g1 ]* M7 p x9 e
}% D4 x: A }; _/ s1 U8 t: ^$ M
% X9 Z0 [3 g' s5 P( g, o' D; z
function mytheme_admin_head() { ?>
6 F' H' `( _& [- o; P0 G( s<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />( D! v$ u$ R/ Z$ \
<?php }$ T5 D0 v4 G8 t; _$ ^9 P i
|
|