|
|

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