|
|

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