|
|

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