|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
/ u+ w1 u' P" c8 a// Theme Option; W7 o3 Q8 M0 } Q5 ]4 i
////////////////////////////////////////////////////////////////////////////////
8 f( f! O: A: M4 O2 A9 l0 e; k" d* c+ a4 E
$themename = "Zenx";
9 O4 z9 S- ]% N7 Z/ T$shortname = str_replace(' ', '_', strtolower($themename));9 a+ ~" W% n* v2 y9 d
" ^1 \1 @" [2 c& Xfunction get_theme_option($option)
' b/ \. c x+ B1 M) @; K5 Q8 m{
Z- j* g- S! @5 Q& @ global $shortname;1 G2 R: C" \4 n. _1 [. v; w) Q% k" e
return stripslashes(get_option($shortname . '_' . $option));
; \: Y8 t" W2 I9 A( J: W}
0 J# o* Q; K9 S. r
) N: P/ M3 d% i! M0 ~. G' |% i: ~- B+ Xfunction get_theme_settings($option)
, i E( r. `5 c) O5 N{
/ H* \& Z0 x9 [* j1 N/ D) d; c return stripslashes(get_option($option));
) j D( y, w; f1 {8 r, P! ]}
% f) T- g, J' n) S$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");5 g8 ~. o" {, v* O
$wp_getcat = array();- a9 F; Z3 e5 B7 K) x
foreach ($wp_dropdown_rd_admin as $category_list) {6 o, B' J% j) c$ I% [. F
$wp_getcat[$category_list->term_id] = $category_list->name;; ^% V& w' m6 e- E
}
. Y1 k: E- E# |0 q8 @3 i, d$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
7 V4 s$ m/ ?0 A( X% _4 {/ C$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");/ w2 R9 z2 [ @% n& \
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");0 I, w9 F/ ~7 M1 Q: `
/ Y8 Y; v6 }8 y4 E* T
$options = array (
! m, S4 l; N' [; g1 a1 q. K @/ ~, Q7 m6 R: c$ ]
7 `; e5 P2 ]2 Q9 E array( "name" => "Blog Header Settings",% E. u4 k7 C! K* A* r! `4 ?
"type" => "heading",
( h8 l" N4 F G( f. |2 i ),
4 M `/ O" u) ]0 Y. G
: R1 P$ R4 V( @# _& k, T% ` array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 F2 @) @& ?0 r7 A/ L2 ?+ C
"id" => $shortname."_header_logo_activate",' q4 E% k' x3 p# ~: b
"type" => "select",6 R6 P% r, j0 g! H, V/ M* K
"std" => "No",
- b2 G7 o% s. N. F "options" => array("No", "Yes")),9 C. |. k% [) `8 ~0 ^) X2 T
- |& ~5 T+ G! I; c% ` array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
# X1 |' d7 W( l& f! _9 A "id" => $shortname."_logo_url",$ g) Z2 s% {& w' F3 j, P% [" I: ]
"type" => "text",& z' w1 V& g E5 k& x/ U2 ?/ \& K
"box" => "social",& z m7 D+ \; |3 R7 H
"std" => "",8 w$ [# V" v' A" ^+ C
),
; m3 ^) e1 O( E1 I( I 6 |" ~/ a& {* o% N1 m
array( "name" => "Insert Header Banner HTML Code (Header)
4 g7 o( N0 p0 [# S# T* F <br /><em>*Recommended Size 468 x 60</em>
+ V e$ k/ g0 r' V+ D- ? <br /><em>*leave blank if not use</em>",
" v% g0 b% ?) `5 Q "id" => $shortname."_header_banner",
9 Z! E$ T5 V/ z: s9 c "type" => "textarea",+ C# x* j! O& j# _8 ?6 @
"std" => "",
0 Y; s. L- q8 l, ]1 N( t6 B& } ),/ B% }1 i8 p4 O/ x4 ^
6 I" o; `1 A8 g+ W4 I# |2 J6 p array( "name" => "</div></div>",$ F9 \0 d! O( {+ b! w) i" R# ^
"type" => "close",
8 r, o0 M, ]( n( P2 Y2 E! Y, P ),
$ F0 S: J# j2 g. b1 C& b- @3 o- r7 A" C* Y8 }: I
9 v( _/ z( d* c3 {8 y
array( "name" => "Header Navigation Settings",2 ]. ]' G. T* K' A2 j' H
"type" => "heading",* c0 W. w- E% Y2 m5 o
),
b1 O& r- S+ C* {& E3 C: h% A' [: D1 @+ V! C @
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
B1 A: ?$ w8 t7 T2 @3 ] <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />2 b0 I1 z+ q9 _$ i, O- n) ]5 j! a: B
<em>*Enter the page post ID number only</em><br />& D8 N& f* s5 g
<em>*separate by comma</em><br />6 k1 p/ X+ j1 n
<em>*Exclude pages which you don't want to show on the header navigation</em>",; e+ \# J* V6 z$ Z( R# F t
"id" => $shortname."_header_page_navigation",( W1 x& m& p4 Y8 r' I3 N( ^
"type" => "text",& S( b, B$ d, ]( s9 @
"std" => "",% f( T; R/ C; a( o" Y" s* {$ a* K
),
. L. a6 S. y# u& a! B& H _6 }
! l8 z5 I7 C, G0 u) `9 i array( "name" => "</div></div>",
7 I6 [6 c4 t1 |/ L2 j "type" => "close",
2 z4 N, g5 t ~: Y) b( ^- u ),
4 M& m% G( N3 T5 |+ C
8 `2 I: Q) ?# i* R, K4 S9 @7 z( C2 |0 `$ ~" B( P
array( "name" => "Post Auto Thumbnails Settings",3 A& w1 t$ f# }7 J* g! Y& ]2 Q* p
"type" => "heading",
; J p! K3 @+ l! ]$ u; H1 g ),
0 Z- S; _( i! t1 v ) o& U: b6 |7 _$ M) t' K7 V
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" a6 L P0 `# ` "id" => $shortname."_timthumb_activate",
: l* R) k( p3 d p+ H3 l9 u "type" => "select",! k; T/ J2 c2 E
"std" => "No",
. Z4 j" y/ u. M! D1 @: a6 w "options" => array("No", "Yes")),
; f8 W5 [) e7 Z5 D, o0 B i
& ^' \, y( J+ y array( "name" => "If Timthumb is enabled, Please choose its cropping method",
7 _3 \8 Y9 i4 c" B8 \0 g( Q% K$ l# k "id" => $shortname."_timthumb_cropping",
+ W% x4 s5 |9 g, e {/ e, W) G "type" => "select",- W) O- L! |9 Q& w
"std" => "",5 x* i8 D+ [9 ]+ @/ I
"options" => $crop_position),# k2 W, I3 e& Y1 U; J, l; M& u
$ Y% C5 ]% \: b array( "name" => "Insert Width Of Thumbnail Image<br />0 g8 C6 N; F3 z+ y p; U9 l
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
9 w( P- D% M5 Y& [3 g, o+ P <em>*Leave Blank To Use Default: 250</em><br />",9 ]6 ~* e: T8 p) H( I
"id" => $shortname."_thumb_width",& f; l# A5 B1 t& y; f9 }$ _* I
"type" => "text",
+ |+ R( R! L3 Q& {/ @8 n/ O "std" => "",# p+ i0 p# g( Y+ G
),
1 z2 d' n* Y4 N. L& L$ l1 R9 {& y: m: U- v0 y7 r
array( "name" => "Insert Height Of Thumbnail Image<br />. W7 k/ C% Q% l9 M9 v
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
; K/ p- c/ w- I9 W3 t F8 I% a <em>*Leave Blank To Use Default: 200</em><br />",5 d5 g p* F a( g Q4 t2 u! y
"id" => $shortname."_thumb_height",
! n u- ?$ H: Z3 C, K "type" => "text",
' j- x# g, S$ @( D$ f "std" => "",! v' q, Q' ^4 Y3 q' l
),: L( @- f; v1 g$ N# n/ w, b
! G, A' |, H( L* c3 h array( "name" => "</div></div>",
% s) L! [1 o: x0 r& [% _ "type" => "close", \9 N' N9 W1 j* S5 q
),) B. X, _8 U( R( B, `- _
" `- a. x% N& r+ j9 m. N array( "name" => "Featured Content Slider Settings",
- E( @6 y& w" w+ N" Z$ f: X- t "type" => "heading",' r$ Y8 b) g; J& p" P% v1 z
),
4 ~3 J$ w7 }$ i
7 K$ ~. l5 D: J# w6 T array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- ~ }( [& d+ w' z# y "id" => $shortname."_featured_activate",
" @' |+ ~, b7 m' C7 U- } "type" => "select",$ i$ J" S' W, ?$ t& I2 o
"std" => "No",0 N) i0 C. I$ S0 B% w
"options" => array("No", "Yes")),
4 K1 s6 |0 p& Y4 e* L, M! t- \5 b5 K: t7 l- X' c$ z
+ |) B, D, M" z9 h/ h. B" o! C- m- _
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
5 f s$ N( X) a2 @ "id" => $shortname."_featured_category",- I4 P% j2 _- O9 m! ~9 {
"type" => "select",
L5 E B% J' B. x) Y* ?6 m: k, }* a "std" => "Choose a category:",
7 U* H9 E( e2 ~9 I; Q3 ?5 V2 Y "options" => $wp_getcat),/ l! ^# q0 d0 |) {% E
* F% @/ k! ^: e0 d array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
( x5 {8 o9 W6 p& N4 [ "id" => $shortname."_featured_number",
' | S/ B) u2 L o& a+ l0 ? "type" => "select",5 u! x7 s1 E- r# Q
"std" => "Number of post:",
+ k e" N s- R* m "options" => $number_entries),
$ w N0 o E; Y! \) x: u( g+ W/ F- }7 C) _9 o3 X2 E
array( "name" => "</div></div>",) Z ]/ }: _& b: F9 z9 G9 E
"type" => "close",
/ _5 i1 q( A% i3 {2 |. r+ @' u ),
# o, J u" V) l+ k# a3 f8 f * v/ y$ f9 p( N
array( "name" => "Featured Category Settings",
! m) \' h- c& e "type" => "heading",
" ~. `; Y7 ]: }- D, A9 c ),5 |* E: x8 c; M: P) Z8 h2 ~
2 \& X& P" a5 l" [- a array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 n% x0 J$ p, ? "id" => $shortname."_featured_category_activate",6 y. D: r; E0 a) }0 Z; a
"type" => "select",* [5 o* \0 c$ q1 f0 ?
"std" => "No",
2 W8 m5 G; }9 U4 M; E% y; Z! D4 V; c "options" => array("No", "Yes")),; o6 l3 z& o% Q8 H1 P
6 \9 {) E4 h5 m) S array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",; E; @" v# b" o) V2 W4 d6 g- g
"id" => $shortname."_featured_category_id1",7 k" g! S% C$ o- e3 j
"type" => "select",2 P- T; j b' m% j5 r$ G, A
"std" => "Choose a category:",
) z: E6 X- Z, j "options" => $wp_getcat),
$ @. k; X% \' G ) F$ m5 Z3 o' K& z# K9 Q
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",! u) L3 w; U$ v, e! w9 J. p7 n, R' @
"id" => $shortname."_featured_number1",
8 S9 g" o) }0 e, g; t& r9 X9 C "type" => "select",
) n$ f% k- |8 u0 @ "std" => "Number of post:",
$ t3 E! q6 l7 a "options" => $number_entries),2 V$ [6 J" a% k. t5 t
8 s. S: u; f8 ~' E- N+ H array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
) p9 u# Z, A q+ [ "id" => $shortname."_featured_category_id2",
& r3 x/ b4 M: }: } "type" => "select",2 S4 ^4 l/ W3 p$ ?. s5 F
"std" => "Choose a category:",+ k) `, J( A8 a
"options" => $wp_getcat),1 R- \/ M5 n. h9 p# k
3 g& e: R* ~/ N; F0 H1 A/ W" z array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",& q' m0 h7 o! `* E
"id" => $shortname."_featured_number2",
& D$ V- L8 e9 y: X/ w5 d/ N( _$ {' C "type" => "select",
; J. F( r# U t. f "std" => "Number of post:",2 I$ y5 x" g9 |% C: Y1 a5 U6 R$ T
"options" => $number_entries),5 B9 m+ z# R4 J4 @3 t- V
6 I- G2 E% E @( d2 j* ^4 Q
/ t0 `% w" \8 P0 T$ x% u array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
4 P+ A: e, {' ^" m+ S+ N$ k$ f# f "id" => $shortname."_featured_category_id3",. v$ E3 E7 n' @/ z# @3 \5 x
"type" => "select",3 T' N# i+ j% t: |! g0 [5 F1 \
"std" => "Choose a category:"," R) Y1 m! [& r F; O; x
"options" => $wp_getcat),
& b+ g! h4 V! O6 a: L 4 g! L& T) V+ q) |
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",6 d' L& r9 J2 ~+ w$ g2 r
"id" => $shortname."_featured_number3",
1 A2 V& H9 z& O* U7 l. |; _& ]" E "type" => "select",, O% \# S; \9 E v$ F: M6 x/ T2 b
"std" => "Number of post:",2 j! C; u! S/ S8 q! X* L1 t, S2 o
"options" => $number_entries),
" ^/ B" a" h! l# `
5 K) s L) u3 m; a; ~( L. J* z
" m% S1 z1 ?0 }' c' ^9 L array( "name" => "</div></div>", y# x) O, Q% d0 N( x7 R6 K& `5 a
"type" => "close",
1 a2 q+ c3 V: g4 k6 D2 f ),$ |" k* R/ L" h+ ~% j' z0 d
1 w2 v" k: g7 i0 l, r% h* \
/ a1 `( f( o9 U f! @- K. z% G4 K array( "name" => "Google Adsense & Analytics Settings",
' o; n7 {- g1 J% y4 J& j "type" => "heading",
0 E' J/ q# ^* K6 f ),
# r/ E, O4 Y0 i6 ?8 n0 C' p" j0 J; X% K" X( [) Y3 i9 l
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
5 Q. I( y @2 x. J "id" => $shortname."_adsense_loop_activate",) Y3 F5 ]! N6 [7 f: e; f8 Y1 r
"type" => "select",0 R8 I5 y: X/ {6 w' O+ h
"std" => "Disable",- D5 Z% Y8 n6 a( V3 E! i2 W
"options" => array("Disable", "Enable")),
. z- `+ N- s! @& L4 i4 r9 ?6 }% u& z
array( "name" => "Insert Google Adsense Code For Loops Here<br />, k$ Y3 p( Z" D z) i0 w: x
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
+ c" Z U2 f/ C6 b "id" => $shortname."_adsense_loop",. ?; i- O4 Z9 r; y j
"type" => "textarea",: `/ f! _ ]( p
"std" => "",& t# b' ^( F/ |1 O) z+ E" I
),. D: T1 b2 E4 Z* p9 }
6 N* X7 f# ^3 w% n* I/ W; D6 x+ o ~
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",7 ~- l! ]( k: F% y4 D4 a) e
"id" => $shortname."_adsense_single_activate",3 {7 U+ k4 `& j3 z+ T8 x7 X
"type" => "select",* u! t2 r$ f/ t9 Y' L; e) ^
"std" => "Disable", S# t6 W3 q! D l
"options" => array("Disable", "Enable")),7 \$ T. {5 {4 a0 M, q
3 T7 G4 A. @# q- z" V& B array( "name" => "Insert Google Adsense Code For Single Page Here<br />
- Z9 }( l- I1 |0 z+ Q5 M# ~5 N <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
4 r+ [1 I S+ ~1 Y) i" ? "id" => $shortname."_adsense_single",( r+ m3 b4 r; s- G" U+ l" K+ |
"type" => "textarea",$ M* p0 o" w& _4 w7 K1 _6 V& L' Z0 e
"std" => "",' C( S" e4 w( k7 j
),
0 o* B: P! z" [) v8 W* j
7 f) @3 P) u" r2 F# d. j! c3 [1 P$ D0 d" \% n+ ]$ V& W
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
# V) b& A0 f t5 D( Z! K5 _ "id" => $shortname."_google_analytics",) w2 v5 o: E3 w* q/ Q) y. b
"type" => "textarea",
. y5 ]* o* i' W& I "std" => "",
8 T; b& S+ r4 m ),
! f: A1 P+ h+ R8 d
' x7 X: G, M* \% [8 I array( "name" => "</div></div>",
+ G! E. Y4 ]. e7 h5 H "type" => "close",
# g% y) v% u7 u) C$ J% V9 J ),
& T6 I1 V5 C5 }6 X+ U J * K! }; J& ^, @9 s+ D
8 y2 w* {3 B# e g) A' ]1 }
array( "name" => "AddThis Social Bookmarking Settings",
) y( |! t% g; [4 X: }$ Z p "type" => "heading",
' Z9 V2 @% `* d ),
0 J# S0 y! d7 m
; \1 ], y1 U) W* [$ B9 i array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>, J4 E C9 ~) [
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
) \. o- b3 N* k3 h- a/ }4 s+ t "id" => $shortname."_addthis",
, V. B7 f" g" B "type" => "text",
9 P; U1 ^1 Y8 x "box" => "social",% e+ t6 q1 e1 U
"std" => "",0 Y, \/ `" V3 y# q$ O+ D) z3 `8 w
),
1 s, _6 i5 Q# i% {% y C# C$ z7 ]. q
( V2 x' ~/ Z [2 z7 d* c) R array( "name" => "</div></div>",
3 y& M0 I/ @5 f8 Y9 G1 O "type" => "close",
4 }3 R: X4 L& U) {+ [ ),
) U8 z5 v( E, d, U, G: \ $ j: j1 A4 y9 ?: H) W( x
# D/ o: C+ P( n; f* d
8 S1 X6 i9 C; q2 e array( "name" => "YouTube Video Settings",
+ P: o. g6 _8 F1 H7 | D "type" => "heading",
/ [# x7 ]6 u. Z: L) y" ?6 O; O! Z ),. z" n) t1 C1 h5 d
5 G, N# p% X; n; \
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* h4 ~! N4 p4 x* ^: f" W
"id" => $shortname."_emvideo_activate",# |# M! A: c+ o, z+ B2 ^
"type" => "select",4 K z. {4 N6 F4 R7 {0 T4 r; \
"std" => "No",
& E" [% B' C# }. E- S "options" => array("No", "Yes")),6 F, C7 e0 \- @' s; G0 o! B
2 K, M! f$ H; ^3 h$ }# Q' A 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>",
) f8 J/ t9 \; N4 k "id" => $shortname."_emvideo",
8 M- t3 m8 l" N4 q; C1 y "std" => "",% y6 ^2 }, ]7 j7 }0 \! t# p
"type" => "text"),
$ V4 J( w. n5 S, p1 O
4 M6 D, N. x6 P5 Q$ A# Q @# N3 m array( "name" => "</div></div>",! ~; F' E- o* y4 q
"type" => "close",
6 \3 }( T& N/ y0 C ),
+ K( S( j; v$ |, I) B! [7 f
2 P- h. y! u! e \4 C e array( "name" => "Twitter Settings",# U% \: S: i Y8 e5 Z% ]
"type" => "heading",
' ]3 X7 H4 ]7 |, [+ L( o ),
0 Y# g) m; j ^/ N, B4 x: d( h' V( y$ K( y/ i' x$ }, H) K' r
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 y* d! {$ A( c# Y
"id" => $shortname."_twitter_activate",
0 J1 E& w/ E1 a% @9 o/ Z4 F "type" => "select",4 G% X* M1 ^6 h0 L& `9 E
"std" => "No",
/ ^ @, x8 ?! I) b! _# Y "options" => array("No", "Yes")),# C9 P+ V& w& Z- I
/ A% l- b8 x# j/ T2 D! v) T array( "name" => "Insert Your Twitter ID here
3 m' `1 s. {1 {% O. G |8 ]- R I <br /><em>*leave blank if not necessary</em>% E8 }$ W% l* v6 |' T! L+ A7 D- v
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",) }5 B j- _9 N) \; v4 {$ s
"id" => $shortname."_twitter",
1 U( d3 A% h3 ]0 x8 A3 z4 G "type" => "text",8 j+ N" O" q4 y+ G
"box" => "social",
" t( [: U3 H' K3 X* H. a1 f- s1 _ "std" => "",
* h0 s# E# ~* g0 o4 Z ),
0 g3 h+ }7 e6 L3 B P7 u0 ?# c2 P' k0 l
array( "name" => "Enter Twitter Feed Count here
; n9 d0 q# ~$ v7 f/ R# a- U" i <br /><em>*leave blank if not necessary</em>
* e- y4 t6 N3 E6 h& p: G7 n <br /><em>*Enter How Many Twitter Feed To Display</em>",
: Q8 Q+ s( N4 M1 O; e "id" => $shortname."_twitter_count",% u9 N3 Z+ Q8 D4 ~2 o! E" z8 @& v) f6 m' T
"type" => "text",0 V1 |: u+ j6 u5 X7 m2 _* C n
"box" => "social",. u6 z! \& J& L& e# j+ R( M
"std" => "",8 \1 w N+ l& H
),
1 {& c% I% r' ?1 u6 V6 X
/ R% N' O0 C5 S/ n1 m array( "name" => "</div></div>",4 d6 X% q+ D) a7 F' N; K( d: f8 M- e
"type" => "close",
?1 i* v; I1 L ),
' N4 L7 a- {% a7 c
4 J9 S; @! x$ n. U' c5 B& \7 i; I% i- C' `
array( "name" => "125 x 125 Banners Advertisement Settings",9 q' _# e# v* f0 q6 c' J
"type" => "heading",! [/ B' b( n# y5 K4 {. V! | y
),
% L6 X I* Y8 Z- {& u+ D3 G0 w9 P( n. ^
8 _3 I7 K* S$ H$ N/ j* k1 t2 o0 e" O array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," }/ [/ E9 R0 q# L) t
"id" => $shortname."_sponsor_activate",
2 [ r, e+ i' j$ c' L "type" => "select",& ~0 {; b% K9 O( {( J, E) z
"std" => "No",! a1 C7 ~; b' ?
"options" => array("No", "Yes")),
: m+ H6 L: R2 Q6 b0 m2 I7 ]9 ]
9 W6 C- Q9 M, @" b, Z6 S0 d4 I: R# u- V6 `' N( \
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
; Z b% w% `3 u: {( _" T "id" => $shortname."_sponsor_banner_one",. y) N* F! X" n
"type" => "textarea",# \. N7 Z- M2 h0 F d0 z
"std" => "",, B$ q# x- q0 Z: U3 p! B; ?
),
- h6 s) R2 U9 `" B$ U& S* A$ r& f; T0 O+ ^* T# d
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
& F2 b, C0 M5 @1 n. G5 Q "id" => $shortname."_sponsor_banner_two",8 K+ i8 t! b, y9 }
"type" => "textarea",
: P4 e, |6 u4 W6 u "std" => "",2 H& l4 k" b: G1 n
),, ^" F+ a/ u& r2 S; ?: F
1 i! m* M) |; \/ k+ i array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
4 E% O1 p( ~& z "id" => $shortname."_sponsor_banner_three",! R3 v1 q% ^* \* \* x8 O& r2 p
"type" => "textarea",3 Z& n! c1 J3 t) |0 j; r i
"std" => "",+ U E! N0 r6 w# x
),
8 n/ [! x+ |9 l3 R9 g( q$ k) n6 A9 [1 u3 n" L' L3 c
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",! D# R3 s. Z5 \. S6 k1 J5 U. w/ ]
"id" => $shortname."_sponsor_banner_four",. r( G& E4 M* m; D& m
"type" => "textarea",1 R& x3 H3 N+ W
"std" => "",: i( v& s: ~! `1 g
),
7 Z3 Q0 O6 g1 {3 _" U' c% b7 c' G" ?) v6 X }% \" g5 |% a/ C% w) D0 N: _
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",: M, `3 i' E1 J; A! u9 T
"id" => $shortname."_sponsor_banner_five",
: }% M8 y) K6 H3 w" o6 \" Y "type" => "textarea",+ u$ q; @ u. |- G
"std" => "",+ L" Z- x' E. f& n9 c
),4 f, w0 E- M, j* B; h) N! F5 g
8 s4 b; {5 U; n- i! Q, {: w array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",, t; k, V9 ?- G* \* r
"id" => $shortname."_sponsor_banner_six",
* v) t+ u/ b2 a- ` "type" => "textarea",8 g G- o9 k( X. Z1 y7 M
"std" => "",, q& |; a( Y" y4 ?, t q, Q
),( f: Y# f% [1 n
0 B" r4 h1 E/ W* U array( "name" => "</div></div>",+ a+ U/ A1 o# R8 g
"type" => "close",
u: S+ o. y" P4 m9 J. m7 f! X0 \ ),
( E4 Z$ B9 |5 B0 k1 e4 t- }0 t1 P, t# ?5 T! t: E
# J8 D2 V3 u) n4 ^5 f, f
2 c; c1 \9 c; S);
# u8 w! q' m3 w" @2 w2 O; J A5 d& J! W3 U7 U- C4 x( b2 ?
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {0 ^ X; e- w% Q
0 n, R9 Q! i" k8 a$ V& q& w. h* yecho "<div id=\"admin-options\"> ";& R; j D5 r, U& f6 s4 b4 C
" }$ C+ ?! V- R& C% Q# n, Z; J
global $themename, $shortname, $options;8 Q3 I7 i3 C: f8 {! h- B
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
7 \% x6 j- P1 q* M7 N# Oif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';4 B) f+ f; `7 X
?>* @+ I! A9 ?; R: n) x7 f
& j3 d- t) J: e
<h4><?php echo "$themename"; ?> Theme Options</h4>5 P) o8 ? j4 w# m" ]
3 V# F3 ]* V& q, N9 N' C
<div class="annouce">1 g0 [/ |5 w0 ]! d& W7 ^! Z6 s
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>) x8 k; F% {' W8 M, F) H
<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 G7 q& S7 _' s. `% s
</div>: g( D: O/ x8 z1 n" Z0 B
& l! a. v" t/ _" M/ s5 F<form action="" method="post">, V3 Q( E0 W& @+ M
6 a8 M9 I. d( \6 b; D% `3 V
<?php foreach ($options as $value) { ?>
) ]8 h4 q W$ g G5 D
5 @$ w9 m; y- ]8 u<?php switch ( $value['type'] ) { case 'heading': ?>( m" k4 ^( _& ^5 V% h! @. _$ r' i
* o7 [ d! \ O- t! D' |4 t
<div class="get-option">/ h2 ?5 _8 Z+ O) b
: ^5 \! C" x+ A1 {& U0 d
<h2><?php echo $value['name']; ?></h2>
% E$ x/ Z2 [" o, \9 S! A0 z
# H% e) k% p+ M% Q<div class="option-save">
4 T. D* Y# h& K; R) S
/ j2 g! E. r& p0 x3 P<?php9 w. u8 u0 p2 l& l7 Z/ J
break;
) B; h# Y1 D- S) Q% x4 }* Ncase 'text':. L( X& |" m9 N5 N3 L! {
?>
5 ~# G$ e: c1 D; p$ h
+ T$ ~- b( U3 m3 x7 n, Z& E L! q, T, l<div class="description"><?php echo $value['name']; ?></div>
( E+ A" e& c7 Q6 k+ |/ \+ L, Q<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (+ T% J/ s9 n4 I' ?% p$ m
s0 m2 j- r$ L2 i, w1 I! C' ?( X; Nget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
: m& a9 ]7 }; s% ~9 s: o4 h" q2 s! x- U2 Q Q: a( N W9 H$ ~
<?php0 {; S' S% R( |1 k% p% i
break;; X" ?' W: p- J( V3 V
case 'select':
q* s8 ^+ I, ]% q$ H?>
6 [, l1 S! ^2 o# H6 s7 C; [
, @1 O# a b4 w m, q<div class="description"><?php echo $value['name']; ?></div>: I9 m' T1 Q. I ?0 z% s
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">$ m( X# \! @3 x* p
<?php foreach ($value['options'] as $option) { ?>
+ W( j5 g- V5 p3 Q! T. q8 ]1 [0 `<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
/ n' j5 Z4 X( c1 R4 L+ \<?php } ?>
8 B( Q/ `( D4 c' P. g D</select>
6 t% w+ Z% V( Z5 p6 b: F8 p: f</p>
0 U2 V) L: O6 B' j; e+ O
6 a @/ k% j. q! b+ n6 t- l( s<?php7 l0 l8 u5 d) G9 |7 f
break;
: A6 f) f# v6 \) U# ncase 'textarea':
$ ^) e0 J7 K& M9 @) z9 D' t$valuex = $value['id'];
' \) X7 A6 s7 G- i! ]+ A9 h$valuey = stripslashes($valuex);( u1 H! p) H; t* N: D, E. B
$video_code = get_settings($valuey);
. l* U8 h) L4 X7 S5 }5 @?>
) Z2 G, z; T% t; s3 V" o+ s( D2 k4 F; D O* Q
<div class="description"><?php echo $value['name']; ?></div>7 x9 y( ^4 J- a" v
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }5 N+ l8 c/ ~& k1 d* a* |8 d
. W# Q ~ _% J% |& lelse { echo $value['std']; } ?></textarea></p>2 K+ W8 v% L# Z" w6 t
3 n( ?# y |- l4 I<?php" W. l3 E2 g$ c& i+ j6 o
break;0 e1 ~5 E2 _% }2 @% i& ^
case 'close':, A1 B0 F. E0 ^3 g/ t+ J" R: v
?>
$ m( E% V7 w6 a- m& c
4 _& r2 ]$ I R* n6 y" P<div class="clearfix"></div>
8 h: `0 n* M) z$ @1 d2 ^</div><!-- OPTION SAVE END -->
7 n% s) i# ^$ A* I. E2 [0 n8 F2 h- M& K& k4 E, n& r
<div class="clearfix"></div>6 s7 t% c" j5 F
</div><!-- GET OPTION END -->
8 `+ u. A* a9 M, j( J( s! [, l/ R4 h% }: J- p; g& U
<?php
- b* Q: b+ l% d; \' y8 B0 g- Z) Ibreak;+ N+ Q" J2 P, c1 m9 N4 t3 d
default;
# d0 y- ]. P9 Z, q8 m& K3 ^?>
* y' J3 i8 f/ T0 l" p( g6 m% v6 {& ]+ F. Y0 ]; E) Y k) ]8 z
: Q* W3 `* Y P9 U% S
<?php3 q: N, U. A- G3 G& x5 a/ c5 a
break; } ?>
6 m: j5 ?/ |) K0 B
8 R' b0 W4 A# D* E# x W<?php } ?>6 u, D7 g0 d1 R# c; v
/ I$ h' f3 K, K) z1 `* D( m<p class="save-p">
8 R) A3 B H8 I7 P4 ]. E5 K<input name="save" type="submit" class="sbutton" value="Save Options" />9 c+ q5 Q9 n8 g
<input type="hidden" name="action" value="save" />2 a5 H5 `8 Y2 R4 L
</p>
3 _; c7 y! Y. A4 y: C</form>4 N7 Y$ R+ K# n- w
0 Z9 N% B0 T$ q& E+ ~<form method="post">* Y# b3 {- h" E5 d1 Q
<p class="save-p">
+ o; E5 \3 C l<input name="reset" type="submit" class="sbutton" value="Reset Options" />% e& d4 A1 K$ S9 N# q
<input type="hidden" name="action" value="reset" />8 V; D: ^- w/ t9 a5 X( j
</p>
0 X8 h) r' r* k5 U* @</form>& E* ?1 N$ S; S5 L" p/ ?
$ s% s' {" K5 J4 e3 ^0 c; z</div><!-- ADMIN OPTIONS END -->' k+ i: I# |5 E4 _7 s7 g' I
) X6 k. L' c: m4 y& | c, n
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }5 t9 N# R; i$ |+ m& p! Z1 c
/ M! t8 H9 G# n+ `6 X% B" o m
function mytheme_admin_register() {
/ I7 y" q0 P$ j" w0 V- [1 kglobal $themename, $shortname, $options;& d: j2 P2 q/ B, J o+ r
if ( $_GET['page'] == basename(__FILE__) ) {
6 r8 R4 s0 B" C3 J. k5 mif ( 'save' == $_REQUEST['action'] ) {, a% [: t+ S: S. g2 N/ B" w' {1 W9 V
foreach ($options as $value) {
" }; i/ a/ J$ O" ~* E+ k, {$ e9 ?, mupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
% u0 g* y4 p) K: E" s. kforeach ($options as $value) {
' V% N v( s6 {( }if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }) K2 L# |9 j6 g# k+ ?
header("Location: themes.php?page=functions.php&saved=true");
+ w+ p7 H% ^" y% h. a; J2 {die;% Q' r+ ^( R+ Y6 \$ F" k j/ d
} else if( 'reset' == $_REQUEST['action'] ) {1 @, k5 W/ P9 J: r2 `+ @
foreach ($options as $value) {1 Q# Y' B4 m2 w) j8 T9 v
delete_option( $value['id'] ); }
" Z: Y3 R' K7 a+ y3 hheader("Location: themes.php?page=functions.php&reset=true");8 v7 A& x' ]! Z
die;* j: }3 T1 P' S- f( O6 N7 }5 {7 n
}
4 o- g. @/ P- M0 S}& i0 b X" b1 J5 |. f
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');% W' L. U2 `+ O, E6 }$ F
}. l. Q& a) `) F
/ R8 R! P% w {) {' C) [
function mytheme_admin_head() { ?>; l }; w& A7 d# q+ s3 e+ z1 [
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />: Y) T0 N1 b. s* ]8 C' g
<?php }( ], i- U# c$ `' Q
|
|