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