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