|
|

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