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