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