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