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