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