|
|

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