|
|

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